mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-29 05:24:22 +00:00
Police correct content-length headers. (#98)
Motivation: RFC 7540 requires that compliant specifications emit errors if content-length has been incorrectly set. We should have this behaviour by default, though we should allow it to be disabled if necessary. Modifications: - Added content-length checking. - Added flag to disable content-length checking. Result: Better RFC 7540 compliance.
This commit is contained in:
1 parent
08db9d8cd4
commit
aaaeca77f9
12 files changed
+902
-371
No files matched your search
@@ -264,6 +264,11 @@ public enum NIOHTTP2Errors {
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
|
||||
/// A request or response has violated the expected content length, either exceeding or falling beneath it.
|
||||
public struct ContentLengthViolated: NIOHTTP2Error {
|
||||
public init() { }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user