rest-guide icon indicating copy to clipboard operation
rest-guide copied to clipboard

HTTP headers must be handled in case-insensitive manner

Open jpraet opened this issue 2 years ago • 3 comments

According to the spec, HTTP headers are case-insensitive.

The section REST guide section that covers HTTP headers should probably mention this?

Some middleware or tools can alter the casing of the HTTP headers, e.g. normalize them to lowercase. The application should therefore always treat HTTP headers in case-insensitive manner. e.g. in java: HttpServletRequest.getHeader(name) is OK, but watch out with methods like HttpServletRequest.getHeaderNames() because there it is your own responsibility to handle case-insensitivity.

jpraet avatar Feb 06 '23 08:02 jpraet

We could align with this zalando rule: http://opensource.zalando.com/restful-api-guidelines/#132

pvdbosch avatar Feb 14 '23 12:02 pvdbosch

WG agreed to align with Zalando's guideline. I'll work out a PR.

pvdbosch avatar Jun 21 '23 13:06 pvdbosch

created PR: https://github.com/belgif/rest-guide/pull/129

pvdbosch avatar Jun 22 '23 07:06 pvdbosch