8000 http: update list of HTTP status codes by leonklingele · Pull Request #37 · gofiber/utils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

http: update list of HTTP status codes #37

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

Merged
merged 1 commit into from
Nov 12, 2022
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
131 changes: 68 additions & 63 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,70 +66,75 @@ func StatusMessage(status int) string {
return statusMessage[status]
}

// HTTP status codes were copied from net/http.
// NOTE: Keep this in sync with fiber's status code list
var statusMessage = []string{
100: "Continue",
101: "Switching Protocols",
102: "Processing",
103: "Early Hints",
200: "OK",
201: "Created",
202: "Accepted",
203: "Non-Authoritative Information",
204: "No Content",
205: "Reset Content",
206: "Partial Content",
207: "Multi-Status",
208: "Already Reported",
226: "IM Used",
300: "Multiple Choices",
301: "Moved Permanently",
302: "Found",
303: "See Other",
304: "Not Modified",
305: "Use Proxy",
306: "Switch Proxy",
307: "Temporary Redirect",
308: "Permanent Redirect",
400: "Bad Request",
401: "Unauthorized",
402: "Payment Required",
403: "Forbidden",
404: "Not Found",
405: "Method Not Allowed",
406: "Not Acceptable",
407: "Proxy Authentication Required",
408: "Request Timeout",
409: "Conflict",
410: "Gone",
411: "Length Required",
412: "Precondition Failed",
413: "Request Entity Too Large",
414: "Request URI Too Long",
415: "Unsupported Media Type",
416: "Requested Range Not Satisfiable",
417: "Expectation Failed",
418: "I'm a teapot",
421: "Misdirected Request",
422: "Unprocessable Entity",
423: "Locked",
424: "Failed Dependency",
426: "Upgrade Required",
428: "Precondition Required",
429: "Too Many Requests",
431: "Request Header Fields Too Large",
451: "Unavailable For Legal Reasons",
500: "Internal Server Error",
501: "Not Implemented",
502: "Bad Gateway",
503: "Service Unavailable",
504: "Gateway Timeout",
505: "HTTP Version Not Supported",
506: "Variant Also Negotiates",
507: "Insufficient Storage",
508: "Loop Detected",
510: "Not Extended",
511: "Network Authentication Required",
100: "Continue", // StatusContinue
101: "Switching Protocols", // StatusSwitchingProtocols
102: "Processing", // StatusProcessing
103: "Early Hints", // StatusEarlyHints

200: "OK", // StatusOK
201: "Created", // StatusCreated
202: "Accepted", // StatusAccepted
203: "Non-Authoritative Information", // StatusNonAuthoritativeInformation
204: "No Content", // StatusNoContent
205: "Reset Content", // StatusResetContent
206: "Partial Content", // StatusPartialContent
207: "Multi-Status", // StatusMultiStatus
208: "Already Reported", // StatusAlreadyReported
226: "IM Used", // StatusIMUsed

300: "Multiple Choices", // StatusMultipleChoices
301: "Moved Permanently", // StatusMovedPermanently
302: "Found", // StatusFound
303: "See Other", // StatusSeeOther
304: "Not Modified", // StatusNotModified
305: "Use Proxy", // StatusUseProxy
306: "Switch Proxy", // StatusSwitchProxy
307: "Temporary Redirect", // StatusTemporaryRedirect
308: "Permanent Redirect", // StatusPermanentRedirect

400: "Bad Request", // StatusBadRequest
401: "Unauthorized", // StatusUnauthorized
402: "Payment Required", // StatusPaymentRequired
403: "Forbidden", // StatusForbidden
404: "Not Found", // StatusNotFound
405: "Method Not Allowed", // StatusMethodNotAllowed
406: "Not Acceptable", // StatusNotAcceptable
407: "Proxy Authentication Required", // StatusProxyAuthRequired
408: "Request Timeout", // StatusRequestTimeout
409: "Conflict", // StatusConflict
410: "Gone", // StatusGone
411: "Length Required", // StatusLengthRequired
412: "Precondition Failed", // StatusPreconditionFailed
413: "Request Entity Too Large", // StatusRequestEntityTooLarge
414: "Request URI Too Long", // StatusRequestURITooLong
415: "Unsupported Media Type", // StatusUnsupportedMediaType
416: "Requested Range Not Satisfiable", // StatusRequestedRangeNotSatisfiable
417: "Expectation Failed", // StatusExpectationFailed
418: "I'm a teapot", // StatusTeapot
421: "Misdirected Request", // StatusMisdirectedRequest
422: "Unprocessable Entity", // StatusUnprocessableEntity
423: "Locked", // StatusLocked
424: "Failed Dependency", // StatusFailedDependency
425: "Too Early", // StatusTooEarly
426: "Upgrade Required", // StatusUpgradeRequired
428: "Precondition Required", // StatusPreconditionRequired
429: "Too Many Requests", // StatusTooManyRequests
431: "Request Header Fields Too Large", // StatusRequestHeaderFieldsTooLarge
451: "Unavailable For Legal Reasons", // StatusUnavailableForLegalReasons

500: "Internal Server Error", // StatusInternalServerError
501: "Not Implemented", // StatusNotImplemented
502: "Bad Gateway", // StatusBadGateway
503: "Service Unavailable", // StatusServiceUnavailable
504: "Gateway Timeout", // StatusGatewayTimeout
505: "HTTP Version Not Supported", // StatusHTTPVersionNotSupported
506: "Variant Also Negotiates", // StatusVariantAlsoNegotiates
507: "Insufficient Storage", // StatusInsufficientStorage
508: "Loop Detected", // StatusLoopDetected
510: "Not Extended", // StatusNotExtended
511: "Network Authentication Required", // StatusNetworkAuthenticationRequired
}

// MIME types were copied from https://github.com/nginx/nginx/blob/67d2a9541826ecd5db97d604f23460210fd3e517/conf/mime.types with the following updates:
Expand Down
0