statuses: sync with std package

This commit is contained in:
Gerasimos (Makis) Maropoulos 2022-03-02 01:51:55 +02:00
parent 17260d8d5d
commit 43c85d0c85
No known key found for this signature in database
GPG Key ID: 66FCC29BD385FCA6
2 changed files with 64 additions and 64 deletions

View File

@ -102,7 +102,7 @@ func upload(ctx iris.Context) {
_, _, err := ctx.UploadFormFiles(uploadDir, beforeSave) _, _, err := ctx.UploadFormFiles(uploadDir, beforeSave)
if err != nil { if err != nil {
ctx.StopWithError(iris.StatusPayloadTooRage, err) ctx.StopWithError(iris.StatusRequestEntityTooLarge, err)
return return
} }

View File

@ -580,78 +580,78 @@ const (
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. // See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.
// Raw Copy from the future(tip) net/http std package in order to recude the import path of "net/http" for the users. // Raw Copy from the future(tip) net/http std package in order to recude the import path of "net/http" for the users.
const ( const (
StatusContinue = http.StatusContinue StatusContinue = http.StatusContinue // RFC 7231, 6.2.1
StatusSwitchingProtocols = http.StatusSwitchingProtocols StatusSwitchingProtocols = http.StatusSwitchingProtocols // RFC 7231, 6.2.2
StatusProcessing = http.StatusProcessing StatusProcessing = http.StatusProcessing // RFC 2518, 10.1
StatusEarlyHints = http.StatusEarlyHints StatusEarlyHints = http.StatusEarlyHints // RFC 8297
StatusOK = http.StatusOK
StatusCreated = http.StatusCreated
StatusAccepted = http.StatusAccepted
StatusNonAuthoritativeInfo = http.StatusNonAuthoritativeInfo
StatusNoContent = http.StatusNoContent
StatusResetContent = http.StatusResetContent
StatusPartialContent = http.StatusPartialContent
StatusMultiStatus = http.StatusMultiStatus
StatusAlreadyReported = http.StatusAlreadyReported
StatusIMUsed = http.StatusIMUsed
StatusMultipleChoices = http.StatusMultipleChoices StatusOK = http.StatusOK // RFC 7231, 6.3.1
StatusMovedPermanently = http.StatusMovedPermanently StatusCreated = http.StatusCreated // RFC 7231, 6.3.2
StatusFound = http.StatusFound StatusAccepted = http.StatusAccepted // RFC 7231, 6.3.3
StatusSeeOther = http.StatusSeeOther StatusNonAuthoritativeInfo = http.StatusNonAuthoritativeInfo // RFC 7231, 6.3.4
StatusNotModified = http.StatusNotModified StatusNoContent = http.StatusNoContent // RFC 7231, 6.3.5
StatusUseProxy = http.StatusUseProxy StatusResetContent = http.StatusResetContent // RFC 7231, 6.3.6
StatusPartialContent = http.StatusPartialContent // RFC 7233, 4.1
StatusMultiStatus = http.StatusMultiStatus // RFC 4918, 11.1
StatusAlreadyReported = http.StatusAlreadyReported // RFC 5842, 7.1
StatusIMUsed = http.StatusIMUsed // RFC 3229, 10.4.1
StatusTemporaryRedirect = http.StatusTemporaryRedirect StatusMultipleChoices = http.StatusMultipleChoices // RFC 7231, 6.4.1
StatusPermanentRedirect = http.StatusPermanentRedirect StatusMovedPermanently = http.StatusMovedPermanently // RFC 7231, 6.4.2
StatusFound = http.StatusFound // RFC 7231, 6.4.3
StatusSeeOther = http.StatusSeeOther // RFC 7231, 6.4.4
StatusNotModified = http.StatusNotModified // RFC 7232, 4.1
StatusUseProxy = http.StatusUseProxy // RFC 7231, 6.4.5
_ = 306 // RFC 7231, 6.4.6 (Unused)
StatusTemporaryRedirect = http.StatusTemporaryRedirect // RFC 7231, 6.4.7
StatusPermanentRedirect = http.StatusPermanentRedirect // RFC 7538, 3
StatusBadRequest = http.StatusBadRequest StatusBadRequest = http.StatusBadRequest // RFC 7231, 6.5.1
StatusUnauthorized = http.StatusUnauthorized StatusUnauthorized = http.StatusUnauthorized // RFC 7235, 3.1
StatusPaymentRequired = http.StatusPaymentRequired StatusPaymentRequired = http.StatusPaymentRequired // RFC 7231, 6.5.2
StatusForbidden = http.StatusForbidden StatusForbidden = http.StatusForbidden // RFC 7231, 6.5.3
StatusNotFound = http.StatusNotFound StatusNotFound = http.StatusNotFound // RFC 7231, 6.5.4
StatusMethodNotAllowed = http.StatusMethodNotAllowed StatusMethodNotAllowed = http.StatusMethodNotAllowed // RFC 7231, 6.5.5
StatusNotAcceptable = http.StatusNotAcceptable StatusNotAcceptable = http.StatusNotAcceptable // RFC 7231, 6.5.6
StatusProxyAuthRequired = http.StatusProxyAuthRequired StatusProxyAuthRequired = http.StatusProxyAuthRequired // RFC 7235, 3.2
StatusRequestTimeout = http.StatusRequestTimeout StatusRequestTimeout = http.StatusRequestTimeout // RFC 7231, 6.5.7
StatusConflict = http.StatusConflict StatusConflict = http.StatusConflict // RFC 7231, 6.5.8
StatusGone = http.StatusGone StatusGone = http.StatusGone // RFC 7231, 6.5.9
StatusLengthRequired = http.StatusLengthRequired StatusLengthRequired = http.StatusLengthRequired // RFC 7231, 6.5.10
StatusPreconditionFailed = http.StatusPreconditionFailed StatusPreconditionFailed = http.StatusPreconditionFailed // RFC 7232, 4.2
StatusRequestEntityTooLarge = http.StatusRequestEntityTooLarge StatusRequestEntityTooLarge = http.StatusRequestEntityTooLarge // RFC 7231, 6.5.11
StatusPayloadTooRage = StatusRequestEntityTooLarge StatusRequestURITooLong = http.StatusRequestURITooLong // RFC 7231, 6.5.12
StatusRequestURITooLong = http.StatusRequestURITooLong StatusUnsupportedMediaType = http.StatusUnsupportedMediaType // RFC 7231, 6.5.13
StatusUnsupportedMediaType = http.StatusUnsupportedMediaType StatusRequestedRangeNotSatisfiable = http.StatusRequestedRangeNotSatisfiable // RFC 7233, 4.4
StatusRequestedRangeNotSatisfiable = http.StatusRequestedRangeNotSatisfiable StatusExpectationFailed = http.StatusExpectationFailed // RFC 7231, 6.5.14
StatusExpectationFailed = http.StatusExpectationFailed StatusTeapot = http.StatusTeapot // RFC 7168, 2.3.3
StatusTeapot = http.StatusTeapot StatusMisdirectedRequest = http.StatusMisdirectedRequest // RFC 7540, 9.1.2
StatusMisdirectedRequest = http.StatusMisdirectedRequest StatusUnprocessableEntity = http.StatusUnprocessableEntity // RFC 4918, 11.2
StatusUnprocessableEntity = http.StatusUnprocessableEntity StatusLocked = http.StatusLocked // RFC 4918, 11.3
StatusLocked = http.StatusLocked StatusFailedDependency = http.StatusFailedDependency // RFC 4918, 11.4
StatusFailedDependency = http.StatusFailedDependency StatusTooEarly = http.StatusTooEarly // RFC 8470, 5.2.
StatusTooEarly = http.StatusTooEarly StatusUpgradeRequired = http.StatusUpgradeRequired // RFC 7231, 6.5.15
StatusUpgradeRequired = http.StatusUpgradeRequired StatusPreconditionRequired = http.StatusPreconditionRequired // RFC 6585, 3
StatusPreconditionRequired = http.StatusPreconditionRequired StatusTooManyRequests = http.StatusTooManyRequests // RFC 6585, 4
StatusTooManyRequests = http.StatusTooManyRequests StatusRequestHeaderFieldsTooLarge = http.StatusRequestHeaderFieldsTooLarge // RFC 6585, 5
StatusRequestHeaderFieldsTooLarge = http.StatusRequestHeaderFieldsTooLarge StatusUnavailableForLegalReasons = http.StatusUnavailableForLegalReasons // RFC 7725, 3
StatusUnavailableForLegalReasons = http.StatusUnavailableForLegalReasons
// Unofficial Client Errors. // Unofficial Client Errors.
StatusPageExpired = context.StatusPageExpired StatusPageExpired = context.StatusPageExpired
StatusBlockedByWindowsParentalControls = context.StatusBlockedByWindowsParentalControls StatusBlockedByWindowsParentalControls = context.StatusBlockedByWindowsParentalControls
StatusInvalidToken = context.StatusInvalidToken StatusInvalidToken = context.StatusInvalidToken
StatusTokenRequired = context.StatusTokenRequired StatusTokenRequired = context.StatusTokenRequired
// //
StatusInternalServerError = http.StatusInternalServerError StatusInternalServerError = http.StatusInternalServerError // RFC 7231, 6.6.1
StatusNotImplemented = http.StatusNotImplemented StatusNotImplemented = http.StatusNotImplemented // RFC 7231, 6.6.2
StatusBadGateway = http.StatusBadGateway StatusBadGateway = http.StatusBadGateway // RFC 7231, 6.6.3
StatusServiceUnavailable = http.StatusServiceUnavailable StatusServiceUnavailable = http.StatusServiceUnavailable // RFC 7231, 6.6.4
StatusGatewayTimeout = http.StatusGatewayTimeout StatusGatewayTimeout = http.StatusGatewayTimeout // RFC 7231, 6.6.5
StatusHTTPVersionNotSupported = http.StatusHTTPVersionNotSupported StatusHTTPVersionNotSupported = http.StatusHTTPVersionNotSupported // RFC 7231, 6.6.6
StatusVariantAlsoNegotiates = http.StatusVariantAlsoNegotiates StatusVariantAlsoNegotiates = http.StatusVariantAlsoNegotiates // RFC 2295, 8.1
StatusInsufficientStorage = http.StatusInsufficientStorage StatusInsufficientStorage = http.StatusInsufficientStorage // RFC 4918, 11.5
StatusLoopDetected = http.StatusLoopDetected StatusLoopDetected = http.StatusLoopDetected // RFC 5842, 7.2
StatusNotExtended = http.StatusNotExtended StatusNotExtended = http.StatusNotExtended // RFC 2774, 7
StatusNetworkAuthenticationRequired = http.StatusNetworkAuthenticationRequired StatusNetworkAuthenticationRequired = http.StatusNetworkAuthenticationRequired // RFC 6585, 6
// Unofficial Server Errors. // Unofficial Server Errors.
StatusBandwidthLimitExceeded = context.StatusBandwidthLimitExceeded StatusBandwidthLimitExceeded = context.StatusBandwidthLimitExceeded
StatusInvalidSSLCertificate = context.StatusInvalidSSLCertificate StatusInvalidSSLCertificate = context.StatusInvalidSSLCertificate