We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c55e3a2 commit 94c9239Copy full SHA for 94c9239
src/core/response.ml
@@ -15,7 +15,11 @@ let set_code code self = { self with code }
15
let make_raw ?(headers = []) ~code body : t =
16
(* add content length to response *)
17
let headers =
18
- Headers.set "Content-Length" (string_of_int (String.length body)) headers
+ if Headers.contains "content-length" headers then
19
+ (* do not override user-provided headers (e.g. in HEAD), see #92 *)
20
+ headers
21
+ else
22
+ Headers.set "Content-Length" (string_of_int (String.length body)) headers
23
in
24
{ code; headers; body = `String body }
25
0 commit comments