Merge pull request #55 from guoye-zhang/fix-error

Wrong error thrown when parsing trailer fields
This commit is contained in:
Guoye Zhang authored and GitHub committed 2024-06-28 11:24:13 -07:00
commit e6359663d1
1 file changed
+2 -2
+2 -2
View File
@@ -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