ocaml-cohttp icon indicating copy to clipboard operation
ocaml-cohttp copied to clipboard

cohttp(client): Host header field should be the first header field

Open bikallem opened this issue 3 years ago • 2 comments

From https://www.rfc-editor.org/rfc/rfc9110#section-7.2

A user agent that sends Host SHOULD send it as the first field in the header section of a request. For example, a GET >request to the origin server for http://www.example.org/pub/WWW/ would begin with:

GET /pub/WWW/ HTTP/1.1
Host: www.example.org

bikallem avatar Sep 06 '22 16:09 bikallem

It says should, not must, though

mseri avatar Sep 15 '22 12:09 mseri

It says should, not must, though

Indeed. According to RFC 2119 "SHOULD" = "recommended best practice".

SHOULD This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.

I haven't found a counter explanation to not do it as per the spec.

bikallem avatar Sep 15 '22 13:09 bikallem