Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor http response status equatable #335

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 3 additions & 119 deletions Sources/NIOHTTP1/HTTPTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1253,126 +1253,10 @@ extension HTTPResponseStatus: Equatable {
switch (lhs, rhs) {
case (.custom(let lcode, let lreason), .custom(let rcode, let rreason)):
return lcode == rcode && lreason == rreason
case (.continue, .continue):
return true
case (.switchingProtocols, .switchingProtocols):
return true
case (.processing, .processing):
return true
case (.ok, .ok):
return true
case (.created, .created):
return true
case (.accepted, .accepted):
return true
case (.nonAuthoritativeInformation, .nonAuthoritativeInformation):
return true
case (.noContent, .noContent):
return true
case (.resetContent, .resetContent):
return true
case (.partialContent, .partialContent):
return true
case (.multiStatus, .multiStatus):
return true
case (.alreadyReported, .alreadyReported):
return true
case (.imUsed, .imUsed):
return true
case (.multipleChoices, .multipleChoices):
return true
case (.movedPermanently, .movedPermanently):
return true
case (.found, .found):
return true
case (.seeOther, .seeOther):
return true
case (.notModified, .notModified):
return true
case (.useProxy, .useProxy):
return true
case (.temporaryRedirect, .temporaryRedirect):
return true
case (.permanentRedirect, .permanentRedirect):
return true
case (.badRequest, .badRequest):
return true
case (.unauthorized, .unauthorized):
return true
case (.paymentRequired, .paymentRequired):
return true
case (.forbidden, .forbidden):
return true
case (.notFound, .notFound):
return true
case (.methodNotAllowed, .methodNotAllowed):
return true
case (.notAcceptable, .notAcceptable):
return true
case (.proxyAuthenticationRequired, .proxyAuthenticationRequired):
return true
case (.requestTimeout, .requestTimeout):
return true
case (.conflict, .conflict):
return true
case (.gone, .gone):
return true
case (.lengthRequired, .lengthRequired):
return true
case (.preconditionFailed, .preconditionFailed):
return true
case (.payloadTooLarge, .payloadTooLarge):
return true
case (.uriTooLong, .uriTooLong):
return true
case (.unsupportedMediaType, .unsupportedMediaType):
return true
case (.rangeNotSatisfiable, .rangeNotSatisfiable):
return true
case (.expectationFailed, .expectationFailed):
return true
case (.misdirectedRequest, .misdirectedRequest):
return true
case (.unprocessableEntity, .unprocessableEntity):
return true
case (.locked, .locked):
return true
case (.failedDependency, .failedDependency):
return true
case (.upgradeRequired, .upgradeRequired):
return true
case (.preconditionRequired, .preconditionRequired):
return true
case (.tooManyRequests, .tooManyRequests):
return true
case (.requestHeaderFieldsTooLarge, .requestHeaderFieldsTooLarge):
return true
case (.unavailableForLegalReasons, .unavailableForLegalReasons):
return true
case (.internalServerError, .internalServerError):
return true
case (.notImplemented, .notImplemented):
return true
case (.badGateway, .badGateway):
return true
case (.serviceUnavailable, .serviceUnavailable):
return true
case (.gatewayTimeout, .gatewayTimeout):
return true
case (.httpVersionNotSupported, .httpVersionNotSupported):
return true
case (.variantAlsoNegotiates, .variantAlsoNegotiates):
return true
case (.insufficientStorage, .insufficientStorage):
return true
case (.loopDetected, .loopDetected):
return true
case (.notExtended, .notExtended):
return true
case (.networkAuthenticationRequired, .networkAuthenticationRequired):
return true
default:
case (.custom, _), (_, .custom):
return false
default:
return lhs.code == rhs.code
}
}
}
Expand Down