Ensure no transfer-encoding when body is forbidden

This commit is contained in:
Cory Benfield committed 2017-10-13 13:44:51 -07:00
1 parent 8c0ac74ce4
commit 6f17b320d5
5 files changed
+162 -4

No files matched your search

+13
View File
@@ -776,6 +776,19 @@ public enum HTTPResponseStatus: Equatable {
case loopDetected
case notExtended
case networkAuthenticationRequired
public var mayHaveResponseBody: Bool {
switch self {
case .`continue`,
.switchingProtocols,
.processing,
.noContent,
.custom where (code < 200) && (code >= 100):
return false
default:
return true
}
}
}
public func ==(lhs: HTTPResponseStatus, rhs: HTTPResponseStatus) -> Bool {