mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-26 04:57:50 +00:00
Enforce pseudo-headers must be first in a header block. (#90)
Motivation: RFC 7540 requires that HTTP/2 pseudo-headers must be first in a HTTP/2 header block, and must occur before any regular headers. We should enforce that requirement. Modifications: - Added checking that pseudo-headers are first in a header block. Result: Better RFC 7540 validation.
This commit is contained in:
1 parent
99e35a8ebb
commit
80b243d8a5
4 files changed
+137
-9
No files matched your search
@@ -172,6 +172,15 @@ public enum NIOHTTP2Errors {
|
||||
}
|
||||
}
|
||||
|
||||
/// A header block contained a pseudo-header after a regular header.
|
||||
public struct PseudoHeaderAfterRegularHeader: NIOHTTP2Error {
|
||||
public var name: String
|
||||
|
||||
public init(_ name: String) {
|
||||
self.name = name
|
||||
}
|
||||
}
|
||||
|
||||
/// An outbound request was about to be sent, but does not contain a Host header.
|
||||
public struct MissingHostHeader: NIOHTTP2Error {
|
||||
public init() { }
|
||||
|
||||
Reference in new issue
Block a user