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:
Cory Benfield authored and Johannes Weiss committed 2019-04-15 16:57:16 +01:00
1 parent 08db9d8cd4
commit aaaeca77f9
12 files changed
+902 -371

No files matched your search

+5
View File
@@ -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() { }
}
}