MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / reason

Function reason

modules/network/http/http.js:768–816  ·  view source on GitHub ↗
(status)

Source from the content-addressed store, hash-verified

766}
767
768function reason(status)
769{
770 const message = `
771100 Continue
772101 Switching Protocols
773200 OK
774201 Created
775202 Accepted
776203 Non-Authoritative Information
777204 No Content
778205 Reset Content
779206 Partial Content
780207 Multi-Status
781300 Multiple Choices
782301 Moved Permanently
783302 Found
784303 See Other
785304 Not Modified
786305 Use Proxy
787307 Temporary Redirect
788400 Bad Request
789401 Unauthorized
790402 Payment Required
791403 Forbidden
792404 Not Found
793405 Method Not Allowed
794406 Not Acceptable
795407 Proxy Authentication Required
796408 Request Timeout
797409 Conflict
798410 Gone
799411 Length Required
800412 Precondition Failed
801413 Request Entity Too Large
802414 Request-URI Too Long
803415 Unsupported Media Type
804416 Requested Range Not Satisfiable
805417 Expectation Failed
806500 Internal Server Error
807501 Not Implemented
808502 Bad Gateway
809503 Service Unavailable
810504 Gateway Timeout
811505 HTTP Version Not Supported
812`;
813 let index = message.indexOf(`\n${status} `);
814 if (index < 0) return "OK";
815 return message.substring(index + 5, message.indexOf("\n", index + 1));
816}
817
818export default Object.freeze({
819 Request,

Callers 1

serverFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected