Skip to content

Commit 8b01e42

Browse files
committed
fix: revert content type change in #850
1 parent eafeecd commit 8b01e42

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

huma.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ func writeResponse(api API, ctx Context, status int, ct string, body any) error
499499
if ctf, ok := body.(ContentTypeFilter); ok {
500500
ct = ctf.ContentType(ct)
501501
}
502+
503+
ctx.SetHeader("Content-Type", ct)
502504
}
503505

504506
if err := transformAndWrite(api, ctx, status, ct, body); err != nil {
@@ -543,8 +545,6 @@ func transformAndWrite(api API, ctx Context, status int, ct string, body any) er
543545
}
544546
}
545547

546-
ctx.SetHeader("Content-Type", ct)
547-
548548
return nil
549549
}
550550

0 commit comments

Comments
 (0)