Search code examples
httphttp-headers

Are the HTTP Connection header values case sensitive?


Are values such as keep-alive, Close, and Upgrade of the Connection: header case sensitive?

I'm writing a simple web server and wondering whether I should be transforming the values to lower case before checking them.


Solution

  • I can’t find any explicit specification of the case-sensitivity of the Connection’s field values. But as Connection may contain the name of header fields:

    […] for each connection-token in this field, remove any header field(s) from the message with the same name as the connection-token.

    and as those header field names are case-insensitive, I conclude that the Connection’s field value is also considered case-insensitive.