mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
* Add a subscript to HPACKHeaders to return the first value with a matching name Motivation: In some cases you only expect (or care about) a single value for a header. However, getting this value without allocating an array or traversing the whole array requres using first(where:) provided by Sequence. This is not very ergonomic as it requires users to do the case-insensitive comparison and then exctact the value from the HPACKHeader. Additionally, users cannot use NIO HTTP/2s case insensitive ASCII comparison. Modifications: - Provide a first(name:) method on HPACKHeaders which returns the value from the first header whose name is a case insentive match of the subscript parameter. Result: It's easier to get the first