mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
Ensure no transfer-encoding when body is forbidden
This commit is contained in:
1 parent
8c0ac74ce4
commit
6f17b320d5
5 files changed
+162
-4
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user