Closed BMorearty closed 5 years ago
Let’s start with this but yeah maybe it needs to work with HTTP/2?
Good question...I haven't studied HTTP/2 and don't know if the Connection
header is the same.
So just after I posted I realised the connection header is not used in HTTP/2. Also if you use different cases when things are case insensitive, hpack would be less effective.
Just wondering if we should consider doing this in Protocol::HTTP::Headers
. Shared or general HTTP semantics should go in there
I reworked this slightly and moved the logic into Protocol::HTTP::Headers
. I think it's more logical to do that. Released both gems. But I'll need to check how this behaves in async-http
and perhaps update that too.
Although HTTP header values are case-sensitive in general, RFC 7230 https://tools.ietf.org/html/rfc7230#section-6.1 says: "Connection options are case-insensitive."
See also:
An alternative is to move this logic into to
protocol-http
gem, but it would have to be specific to theconnection
header because many other headers are case-sensitive. If you want it there, the logic would go in the[]=
method to avoid having to check in multiple places (fields
,each
,extract
,to_h
,inspect
,==
).