Closed gonubana closed 6 years ago
Hashes are already ordered in Ruby:
Hashes enumerate their values in the order that the corresponding keys were inserted.
Can you please expand?
1) Pseudo-headers are currently inserted after custom headers provided through Client#prepare_request. 2) When the 2d array containing headers from the server gets converted into a hash, some headers get lost. This happens, for example, when the server sends several "Set-Cookie:" headers.
Got it. Care to issue a pull request?
This will be covered when changes discussed in https://github.com/igrigorik/http-2/pull/132 get applied. Closing but keeping track of the second point in https://github.com/ostinelli/net-http2/issues/27
According to rfc7540 (Section 8.1.2.1), "All pseudo-header fields MUST appear in the header block before regular header fields". Making the request headers in the :headers option be a 2d array instead of a hash could help the client in being compliant with this requirement. Plus, with a 2d array, we can make a request with multiple headers of the same name (like multiple 'cookie' headers) which we can not do with a hash.