File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
## Unreleased
2
+ - cohttp-eio: ensure "Host" header is the first header in http client requests (bikallem #939 )
2
3
- cohttp-eio: add Content-Length header to request/response (bikallem #929 )
3
4
- cohttp-eio: add cohttp-eio client api - Cohttp_eio.Client (bikallem #879 )
4
5
- http: add requires_content_length function for requests and responses (bikallem #879 )
Original file line number Diff line number Diff line change @@ -72,15 +72,16 @@ let response buf_read =
72
72
73
73
let call ?meth ?version ?(headers = Http.Header. init () ) ?(body = Body. Empty )
74
74
~conn host resource_path =
75
+ let host_hdr = " Host" in
75
76
let headers =
76
- if not (Http.Header. mem headers " Host " ) then
77
+ if not (Http.Header. mem headers host_hdr ) then
77
78
let host =
78
79
match host with
79
80
| host , Some port -> host ^ " :" ^ string_of_int port
80
81
| host , None -> host
81
82
in
82
- Http.Header. add headers " Host " host
83
- else headers
83
+ Http.Header. add headers host_hdr host
84
+ else Http.Header. move_to_front headers host_hdr
84
85
in
85
86
let request = Http.Request. make ?meth ?version ~headers resource_path in
86
87
Buf_write. with_flow ~initial_size: 0x1000 conn (fun writer ->
You can’t perform that action at this time.
0 commit comments