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:
Cory Benfield authored and GitHub committed 2019-04-12 16:01:43 +01:00
1 parent b4a9ed3877
commit ae57c2a0d8
4 files changed
+315 -14

No files matched your search

+12
View File
@@ -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
}
}
}