mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-29 05:24:22 +00:00
Validate that connection-specific headers aren't sent. (#95)
Motivation: RFC 7540 forbids the use of connection-specific header fields, except for TE sent with the value "trailers". We should police that. Modifications: - Added extra policing around regular header fields. Result: Better validation
This commit is contained in:
1 parent
b4a9ed3877
commit
ae57c2a0d8
4 files changed
+315
-14
No files matched your search
@@ -252,6 +252,18 @@ public enum NIOHTTP2Errors {
|
||||
self.fieldName = fieldName
|
||||
}
|
||||
}
|
||||
|
||||
/// Connection-specific header fields are forbidden in HTTP/2: this error is raised when one is
|
||||
/// sent or received.
|
||||
public struct ForbiddenHeaderField: NIOHTTP2Error {
|
||||
public var name: String
|
||||
public var value: String
|
||||
|
||||
public init(name: String, value: String) {
|
||||
self.name = name
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user