mirror of
https://github.com/apple/swift-http-types
synced 2026-11-26 04:57:48 +00:00
Wrong error thrown when parsing trailer fields
This commit is contained in:
1 parent
1ddbea1ee3
commit
981c910492
1 file changed
+2
-2
@@ -36,7 +36,7 @@ struct HTTPParsedFields {
|
||||
case invalidStatus
|
||||
case responseWithRequestPseudo
|
||||
|
||||
case trailersWithPseudo
|
||||
case trailerFieldsWithPseudo
|
||||
|
||||
case multipleContentLength
|
||||
case multipleContentDisposition
|
||||
@@ -138,7 +138,7 @@ struct HTTPParsedFields {
|
||||
var trailerFields: HTTPFields {
|
||||
get throws {
|
||||
if self.method != nil || self.scheme != nil || self.authority != nil || self.path != nil || self.extendedConnectProtocol != nil || self.status != nil {
|
||||
throw ParsingError.responseWithRequestPseudo
|
||||
throw ParsingError.trailerFieldsWithPseudo
|
||||
}
|
||||
try validateFields()
|
||||
return self.fields
|
||||
|
||||
Reference in new issue
Block a user