New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

http-status

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status - npm Package Compare versions

Comparing version 1.3.2 to 1.4.0

4

CHANGELOG.md
# Changelog: HTTP Status
## Version 1.4.0
* codes: add status code classes
## Version 1.3.2

@@ -4,0 +8,0 @@

4

lib/cloudflare.js
// Generated by CoffeeScript 2.3.0
// # Cloudfare extra status code
// # Cloudfare extra status codes
// Cloudflare's reverse proxy service expands the 5xx series of errors space to signal issues with the origin server.
// Cloudflare's reverse proxy service expands the 5xx error class to signal issues with the origin server.
var k, ref, status, v;

@@ -6,0 +6,0 @@

// Generated by CoffeeScript 2.3.0
// # IIS extra status code
// # IIS extra status codes
// Microsoft's Internet Information Services (IIS) web server expands the 4xx error space to signal errors with the client's request.
// Microsoft's Internet Information Services (IIS) web server expands the 4xx error class to signal errors with the client's request.
var k, ref, status, v;

@@ -6,0 +6,0 @@

@@ -1,3 +0,1 @@

export = httpStatus;

@@ -14,2 +12,3 @@

readonly '100_MESSAGE': string;
readonly '100_CLASS': string;
readonly 'CONTINUE': number;

@@ -20,2 +19,3 @@

readonly '101_MESSAGE': string;
readonly '101_CLASS': string;
readonly 'SWITCHING_PROTOCOLS': number;

@@ -26,2 +26,3 @@

readonly '200_MESSAGE': string;
readonly '200_CLASS': string;
readonly 'OK': number;

@@ -32,2 +33,3 @@

readonly '201_MESSAGE': string;
readonly '201_CLASS': string;
readonly 'CREATED': number;

@@ -38,2 +40,3 @@

readonly '202_MESSAGE': string;
readonly '202_CLASS': string;
readonly 'ACCEPTED': number;

@@ -44,2 +47,3 @@

readonly '203_MESSAGE': string;
readonly '203_CLASS': string;
readonly 'NON_AUTHORITATIVE_INFORMATION': number;

@@ -50,2 +54,3 @@

readonly '204_MESSAGE': string;
readonly '204_CLASS': string;
readonly 'NO_CONTENT': number;

@@ -56,2 +61,3 @@

readonly '205_MESSAGE': string;
readonly '205_CLASS': string;
readonly 'RESET_CONTENT': number;

@@ -62,2 +68,3 @@

readonly '206_MESSAGE': string;
readonly '206_CLASS': string;
readonly 'PARTIAL_CONTENT': number;

@@ -68,2 +75,3 @@

readonly '207_MESSAGE': string;
readonly '207_CLASS': string;
readonly 'MULTI_STATUS': number;

@@ -74,2 +82,3 @@

readonly '208_MESSAGE': string;
readonly '208_CLASS': string;
readonly 'ALREADY_REPORTED': number;

@@ -80,2 +89,3 @@

readonly '226_MESSAGE': string;
readonly '226_CLASS': string;
readonly 'IM_USED': number;

@@ -86,2 +96,3 @@

readonly '300_MESSAGE': string;
readonly '300_CLASS': string;
readonly 'MULTIPLE_CHOICES': number;

@@ -92,2 +103,3 @@

readonly '301_MESSAGE': string;
readonly '301_CLASS': string;
readonly 'MOVED_PERMANENTLY': number;

@@ -98,2 +110,3 @@

readonly '302_MESSAGE': string;
readonly '302_CLASS': string;
readonly 'FOUND': number;

@@ -104,2 +117,3 @@

readonly '303_MESSAGE': string;
readonly '303_CLASS': string;
readonly 'SEE_OTHER': number;

@@ -110,2 +124,3 @@

readonly '304_MESSAGE': string;
readonly '304_CLASS': string;
readonly 'NOT_MODIFIED': number;

@@ -116,2 +131,3 @@

readonly '305_MESSAGE': string;
readonly '305_CLASS': string;
readonly 'USE_PROXY': number;

@@ -122,2 +138,3 @@

readonly '306_MESSAGE': string;
readonly '306_CLASS': string;
readonly 'SWITCH_PROXY': number;

@@ -128,2 +145,3 @@

readonly '307_MESSAGE': string;
readonly '307_CLASS': string;
readonly 'TEMPORARY_REDIRECT': number;

@@ -134,2 +152,3 @@

readonly '308_MESSAGE': string;
readonly '308_CLASS': string;
readonly 'PERMANENT_REDIRECT': number;

@@ -140,2 +159,3 @@

readonly '400_MESSAGE': string;
readonly '400_CLASS': string;
readonly 'BAD_REQUEST': number;

@@ -146,2 +166,3 @@

readonly '401_MESSAGE': string;
readonly '401_CLASS': string;
readonly 'UNAUTHORIZED': number;

@@ -152,2 +173,3 @@

readonly '402_MESSAGE': string;
readonly '402_CLASS': string;
readonly 'PAYMENT_REQUIRED': number;

@@ -158,2 +180,3 @@

readonly '403_MESSAGE': string;
readonly '403_CLASS': string;
readonly 'FORBIDDEN': number;

@@ -164,2 +187,3 @@

readonly '404_MESSAGE': string;
readonly '404_CLASS': string;
readonly 'NOT_FOUND': number;

@@ -170,2 +194,3 @@

readonly '405_MESSAGE': string;
readonly '405_CLASS': string;
readonly 'METHOD_NOT_ALLOWED': number;

@@ -176,2 +201,3 @@

readonly '406_MESSAGE': string;
readonly '406_CLASS': string;
readonly 'NOT_ACCEPTABLE': number;

@@ -182,2 +208,3 @@

readonly '407_MESSAGE': string;
readonly '407_CLASS': string;
readonly 'PROXY_AUTHENTICATION_REQUIRED': number;

@@ -188,2 +215,3 @@

readonly '408_MESSAGE': string;
readonly '408_CLASS': string;
readonly 'REQUEST_TIMEOUT': number;

@@ -194,2 +222,3 @@

readonly '409_MESSAGE': string;
readonly '409_CLASS': string;
readonly 'CONFLICT': number;

@@ -200,2 +229,3 @@

readonly '410_MESSAGE': string;
readonly '410_CLASS': string;
readonly 'GONE': number;

@@ -206,2 +236,3 @@

readonly '411_MESSAGE': string;
readonly '411_CLASS': string;
readonly 'LENGTH_REQUIRED': number;

@@ -212,2 +243,3 @@

readonly '412_MESSAGE': string;
readonly '412_CLASS': string;
readonly 'PRECONDITION_FAILED': number;

@@ -218,2 +250,3 @@

readonly '413_MESSAGE': string;
readonly '413_CLASS': string;
readonly 'REQUEST_ENTITY_TOO_LARGE': number;

@@ -224,2 +257,3 @@

readonly '414_MESSAGE': string;
readonly '414_CLASS': string;
readonly 'REQUEST_URI_TOO_LONG': number;

@@ -230,2 +264,3 @@

readonly '415_MESSAGE': string;
readonly '415_CLASS': string;
readonly 'UNSUPPORTED_MEDIA_TYPE': number;

@@ -236,2 +271,3 @@

readonly '416_MESSAGE': string;
readonly '416_CLASS': string;
readonly 'REQUESTED_RANGE_NOT_SATISFIABLE': number;

@@ -242,2 +278,3 @@

readonly '417_MESSAGE': string;
readonly '417_CLASS': string;
readonly 'EXPECTATION_FAILED': number;

@@ -248,2 +285,3 @@

readonly '418_MESSAGE': string;
readonly '418_CLASS': string;
readonly 'IM_A_TEAPOT': number;

@@ -254,2 +292,3 @@

readonly '421_MESSAGE': string;
readonly '421_CLASS': string;
readonly 'MISDIRECTED_REQUEST': number;

@@ -260,2 +299,3 @@

readonly '422_MESSAGE': string;
readonly '422_CLASS': string;
readonly 'UNPROCESSABLE_ENTITY': number;

@@ -266,2 +306,3 @@

readonly '423_MESSAGE': string;
readonly '423_CLASS': string;
readonly 'LOCKED': number;

@@ -272,2 +313,3 @@

readonly '424_MESSAGE': string;
readonly '424_CLASS': string;
readonly 'FAILED_DEPENDENCY': number;

@@ -278,2 +320,3 @@

readonly '426_MESSAGE': string;
readonly '426_CLASS': string;
readonly 'UPGRADE_REQUIRED': number;

@@ -284,2 +327,3 @@

readonly '428_MESSAGE': string;
readonly '428_CLASS': string;
readonly 'PRECONDITION_REQUIRED': number;

@@ -290,2 +334,3 @@

readonly '429_MESSAGE': string;
readonly '429_CLASS': string;
readonly 'TOO_MANY_REQUESTS': number;

@@ -296,2 +341,3 @@

readonly '431_MESSAGE': string;
readonly '431_CLASS': string;
readonly 'REQUEST_HEADER_FIELDS_TOO_LARGE': number;

@@ -302,2 +348,3 @@

readonly '451_MESSAGE': string;
readonly '451_CLASS': string;
readonly 'UNAVAILABLE_FOR_LEGAL_REASONS': number;

@@ -308,2 +355,3 @@

readonly '500_MESSAGE': string;
readonly '500_CLASS': string;
readonly 'INTERNAL_SERVER_ERROR': number;

@@ -314,2 +362,3 @@

readonly '501_MESSAGE': string;
readonly '501_CLASS': string;
readonly 'NOT_IMPLEMENTED': number;

@@ -320,2 +369,3 @@

readonly '_MESSAGE': string;
readonly '_CLASS': string;
readonly 'BAD_GATEWAY': number;

@@ -326,2 +376,3 @@

readonly '503_MESSAGE': string;
readonly '503_CLASS': string;
readonly 'SERVICE_UNAVAILABLE': number;

@@ -332,2 +383,3 @@

readonly '504_MESSAGE': string;
readonly '504_CLASS': string;
readonly 'GATEWAY_TIMEOUT': number;

@@ -338,2 +390,3 @@

readonly '505_MESSAGE': string;
readonly '505_CLASS': string;
readonly 'HTTP_VERSION_NOT_SUPPORTED': number;

@@ -344,2 +397,3 @@

readonly '506_MESSAGE': string;
readonly '506_CLASS': string;
readonly 'VARIANT_ALSO_NEGOTIATES': number;

@@ -350,2 +404,3 @@

readonly '507_MESSAGE': string;
readonly '507_CLASS': string;
readonly 'INSUFFICIENT_STORAGE': number;

@@ -356,2 +411,3 @@

readonly '508_MESSAGE': string;
readonly '508_CLASS': string;
readonly 'LOOP_DETECTED': number;

@@ -362,2 +418,3 @@

readonly '510_MESSAGE': string;
readonly '510_CLASS': string;
readonly 'NOT_EXTENDED': number;

@@ -368,4 +425,7 @@

readonly '511_MESSAGE': string;
readonly '511_CLASS': string;
readonly 'NETWORK_AUTHENTICATION_REQUIRED': number;
classes: HttpStatusClasses
extra: {

@@ -385,2 +445,31 @@

interface HttpStatusClasses {
readonly '1xx': string;
readonly '1xx_NAME': string;
readonly '1xx_MESSAGE': string;
readonly 'INFORMATIONAL': string;
readonly '2xx': string;
readonly '2xx_NAME': string;
readonly '2xx_MESSAGE': string;
readonly 'SUCCESSFUL': string;
readonly '3xx': string;
readonly '3xx_NAME': string;
readonly '3xx_MESSAGE': string;
readonly 'REDIRECTION': string;
readonly '4xx': string;
readonly '4xx_NAME': string;
readonly '4xx_MESSAGE': string;
readonly 'CLIENT_ERROR': string;
readonly '5xx': string;
readonly '5xx_NAME': string;
readonly '5xx_MESSAGE': string;
readonly 'SERVER_ERROR': string;
}
interface HttpStatusUnofficial {

@@ -391,2 +480,3 @@

readonly '103_MESSAGE': string;
readonly '103_CLASS': string;
readonly 'CHECKPOINT': number;

@@ -397,2 +487,3 @@

readonly '420_MESSAGE': string;
readonly '420_CLASS': string;
readonly 'ENHANCE_YOUR_CALM': number;

@@ -403,2 +494,3 @@

readonly '450_MESSAGE': string;
readonly '450_CLASS': string;
readonly 'BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS': number;

@@ -409,2 +501,3 @@

readonly '498_MESSAGE': string;
readonly '498_CLASS': string;
readonly 'INVALID_TOKEN': number;

@@ -415,2 +508,3 @@

readonly '499_MESSAGE': string;
readonly '499_CLASS': string;
readonly 'TOKEN_REQUIRED': number;

@@ -421,2 +515,3 @@

readonly '509_MESSAGE': string;
readonly '509_CLASS': string;
readonly 'BANDWIDTH_LIMIT_EXCEEDED': number;

@@ -427,2 +522,3 @@

readonly '530_MESSAGE': string;
readonly '530_CLASS': string;
readonly 'SITE_IS_FROZEN': number;

@@ -433,2 +529,3 @@

readonly '598_MESSAGE': string;
readonly '598_CLASS': string;
readonly 'NETWORK_READ_TIMEOUT_ERROR': number;

@@ -443,2 +540,3 @@

readonly '440_MESSAGE': string;
readonly '440_CLASS': string;
readonly 'LOGIN_TIME_OUT': number;

@@ -449,2 +547,3 @@

readonly '449_MESSAGE': string;
readonly '449_CLASS': string;
readonly 'RETRY_WITH': number;

@@ -455,2 +554,3 @@

readonly '451_MESSAGE': string;
readonly '451_CLASS': string;
readonly 'REDIRECT': number;

@@ -465,2 +565,3 @@

readonly '444_MESSAGE': string;
readonly '444_CLASS': string;
readonly 'NO_RESPONSE': number;

@@ -471,2 +572,3 @@

readonly '494_MESSAGE': string;
readonly '494_CLASS': string;
readonly 'REQUEST_HEADER_TOO_LARGE': number;

@@ -477,2 +579,3 @@

readonly '495_MESSAGE': string;
readonly '495_CLASS': string;
readonly 'SSL_CERTIFICATE_ERROR': number;

@@ -483,2 +586,3 @@

readonly '496_MESSAGE': string;
readonly '496_CLASS': string;
readonly 'SSL_CERTIFICATE_REQUIRED': number;

@@ -489,2 +593,3 @@

readonly '497_MESSAGE': string;
readonly '497_CLASS': string;
readonly 'HTTP_REQUEST_SENT_TO_HTTPS_PORT': number;

@@ -495,2 +600,3 @@

readonly '499_MESSAGE': string;
readonly '499_CLASS': string;
readonly 'CLIENT_CLOSED_REQUEST': number;

@@ -505,2 +611,3 @@

readonly '520_MESSAGE': string;
readonly '520_CLASS': string;
readonly 'UNKNOWN_ERROR': number;

@@ -511,2 +618,3 @@

readonly '521_MESSAGE': string;
readonly '521_CLASS': string;
readonly 'WEB_SERVER_IS_DOWN': number;

@@ -517,2 +625,3 @@

readonly '522_MESSAGE': string;
readonly '522_CLASS': string;
readonly 'CONNECTION_TIMED_OUT': number;

@@ -523,2 +632,3 @@

readonly '523_MESSAGE': string;
readonly '523_CLASS': string;
readonly 'ORIGIN_IS_UNREACHABLE': number;

@@ -529,2 +639,3 @@

readonly '524_MESSAGE': string;
readonly '524_CLASS': string;
readonly 'A_TIMEOUT_OCCURRED': number;

@@ -535,2 +646,3 @@

readonly '525_MESSAGE': string;
readonly '525_CLASS': string;
readonly 'SSL_HANDSHAKE_FAILED': number;

@@ -541,2 +653,3 @@

readonly '526_MESSAGE': string;
readonly '526_CLASS': string;
readonly 'INVALID_SSL_CERTIFICATE': number;

@@ -547,2 +660,3 @@

readonly '527_MESSAGE': string;
readonly '527_CLASS': string;
readonly 'RAILGUN_ERROR': number;

@@ -549,0 +663,0 @@

@@ -5,8 +5,44 @@ // Generated by CoffeeScript 2.3.0

// **Reference:**
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1
// - https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
// - https://tools.ietf.org/html/rfc2324#section-2.3.2
// ## Classes
// The first digit of the status-code defines the class of response. The last two digits do not have any categorization role. There are five values for the first digit:
var classes;
classes = {
// 1xx - The 1xx (Informational) class of status code indicates an interim response for communicating connection status or request progress prior to completing the requested action and sending a final response.
'1xx': 'Informational',
'1xx_NAME': 'INFORMATIONAL',
'1xx_MESSAGE': 'Indicates an interim response for communicating connection status or request progress prior to completing the requested action and sending a final response.',
INFORMATIONAL: '1xx',
// 2xx - The 2xx (Successful) class of status code indicates that the client's request was successfully received, understood, and accepted.
'2xx': 'Successful',
'2xx_NAME': 'SUCCESSFUL',
'2xx_MESSAGE': 'Indicates that the client\'s request was successfully received, understood, and accepted.',
SUCCESSFUL: '2xx',
// 3xx - The 3xx (Redirection) class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.
'3xx': 'Redirection',
'3xx_NAME': 'REDIRECTION',
'3xx_MESSAGE': 'Indicates that further action needs to be taken by the user agent in order to fulfill the request.',
REDIRECTION: '3xx',
// 4xx - The 4xx (Client Error) class of status code indicates that the client seems to have erred.
'4xx': 'Client Error',
'4xx_NAME': 'CLIENT_ERROR',
'4xx_MESSAGE': 'Indicates that the client seems to have erred.',
CLIENT_ERROR: '4xx',
// 5xx - The 5xx (Server Error) class of status code indicates that the server is aware that it has erred or is incapable of performing the requested method.
'5xx': 'Server Error',
'5xx_NAME': 'SERVER_ERROR',
'5xx_MESSAGE': 'Indicates that the server is aware that it has erred or is incapable of performing the requested method.',
SERVER_ERROR: '5xx'
};
module.exports = {
classes: classes,
// ## Informational 1xx
// Request received, continuing process.
// Indicates an interim response for communicating connection status or request progress prior to completing the requested action and sending a final response.

@@ -17,2 +53,3 @@ // 100 - The server has received the request headers and the client should proceed to send the request body.

'100_MESSAGE': 'The server has received the request headers and the client should proceed to send the request body.',
'100_CLASS': classes.INFORMATIONAL,
CONTINUE: 100,

@@ -23,2 +60,3 @@ // 101 - The requester has asked the server to switch protocols and the server has agreed to do so.

'101_MESSAGE': 'The requester has asked the server to switch protocols and the server has agreed to do so.',
'101_CLASS': classes.INFORMATIONAL,
SWITCHING_PROTOCOLS: 101,

@@ -29,2 +67,3 @@ // 102 Processing (WebDAV; RFC 2518) - A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request. This code indicates that the server has received and is processing the request, but no response is available yet.[7] This prevents the client from timing out and assuming the request was lost.

'102_MESSAGE': 'A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request. This code indicates that the server has received and is processing the request, but no response is available yet.[7] This prevents the client from timing out and assuming the request was lost.',
'102_CLASS': classes.INFORMATIONAL,
PROCESSING: 102,

@@ -35,6 +74,7 @@ // 103 Early Hints (RFC 8297) - Used to return some response headers before final HTTP message.

'103_MESSAGE': 'Used to return some response headers before final HTTP message.',
'103_CLASS': classes.INFORMATIONAL,
EARLY_HINTS: 103,
// ## Successful 2xx
// The action was successfully received, understood, and accepted.
// Indicates that the client's request was successfully received, understood, and accepted.

@@ -45,2 +85,3 @@ // 200 - Standard response for successful HTTP requests.

'200_MESSAGE': 'Standard response for successful HTTP requests.',
'200_CLASS': classes.SUCCESSFUL,
OK: 200,

@@ -51,2 +92,3 @@ // 201 - The request has been fulfilled, resulting in the creation of a new resource.

'201_MESSAGE': 'The request has been fulfilled, resulting in the creation of a new resource.',
'201_CLASS': classes.SUCCESSFUL,
CREATED: 201,

@@ -57,2 +99,3 @@ // 202 - The request has been accepted for processing, but the processing has not been completed.

'202_MESSAGE': 'The request has been accepted for processing, but the processing has not been completed.',
'202_CLASS': classes.SUCCESSFUL,
ACCEPTED: 202,

@@ -63,2 +106,3 @@ // 203 (since HTTP/1.1) - The server is a transforming proxy (e.g. a Web accelerator) that received a 200 OK from its origin, but is returning a modified version of the origin's response.

'203_MESSAGE': 'The server is a transforming proxy (e.g. a Web accelerator) that received a 200 OK from its origin, but is returning a modified version of the origin\'s response.',
'203_CLASS': classes.SUCCESSFUL,
NON_AUTHORITATIVE_INFORMATION: 203,

@@ -69,2 +113,3 @@ // 204 - The server successfully processed the request and is not returning any content.

'204_MESSAGE': 'The server successfully processed the request and is not returning any content.',
'204_CLASS': classes.SUCCESSFUL,
NO_CONTENT: 204,

@@ -75,2 +120,3 @@ // 205 - The server successfully processed the request, but is not returning any content. Unlike a 204 response, this response requires that the requester reset the document view.

'205_MESSAGE': 'The server successfully processed the request, but is not returning any content. Unlike a 204 response, this response requires that the requester reset the document view.',
'205_CLASS': classes.SUCCESSFUL,
RESET_CONTENT: 205,

@@ -81,2 +127,3 @@ // 206 (RFC 7233) - The server is delivering only part of the resource (byte serving) due to a range header sent by the client.

'206_MESSAGE': 'The server is delivering only part of the resource (byte serving) due to a range header sent by the client.',
'206_CLASS': classes.SUCCESSFUL,
PARTIAL_CONTENT: 206,

@@ -87,2 +134,3 @@ // 207 (WebDAV; RFC 4918) - The message body that follows is by default an XML message and can contain a number of separate response codes, depending on how many sub-requests were made.

'207_MESSAGE': 'The message body that follows is by default an XML message and can contain a number of separate response codes, depending on how many sub-requests were made.',
'207_CLASS': classes.SUCCESSFUL,
MULTI_STATUS: 207,

@@ -93,2 +141,3 @@ // 208 (WebDAV; RFC 5842) - The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.

'208_MESSAGE': 'The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.',
'208_CLASS': classes.SUCCESSFUL,
ALREADY_REPORTED: 208,

@@ -99,6 +148,7 @@ // 226 (RFC 3229) - The server has fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.

'226_MESSAGE': 'The server has fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.',
'226_CLASS': classes.SUCCESSFUL,
IM_USED: 226,
// ## Redirection 3xx
// Further action must be taken in order to complete the request.
// Indicates that further action needs to be taken by the user agent in order to fulfill the request.

@@ -109,2 +159,3 @@ // 300 - Indicates multiple options for the resource from which the client may choose.

'300_MESSAGE': 'Indicates multiple options for the resource from which the client may choose.',
'300_CLASS': classes.REDIRECTION,
MULTIPLE_CHOICES: 300,

@@ -115,2 +166,3 @@ // 301 - This and all future requests should be directed to the given URI.

'301_MESSAGE': 'This and all future requests should be directed to the given URI.',
'301_CLASS': classes.REDIRECTION,
MOVED_PERMANENTLY: 301,

@@ -121,2 +173,3 @@ // 302 - This is an example of industry practice contradicting the standard. The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302 with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.

'302_MESSAGE': 'This is an example of industry practice contradicting the standard. The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302 with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.',
'302_CLASS': classes.REDIRECTION,
FOUND: 302,

@@ -127,2 +180,3 @@ // 303 (since HTTP/1.1) - The response to the request can be found under another URI using the GET method.

'303_MESSAGE': 'The response to the request can be found under another URI using the GET method.',
'303_CLASS': classes.REDIRECTION,
SEE_OTHER: 303,

@@ -133,2 +187,3 @@ // 304 (RFC 7232) - Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.

'304_MESSAGE': 'Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.',
'304_CLASS': classes.REDIRECTION,
NOT_MODIFIED: 304,

@@ -139,2 +194,3 @@ // 305 (since HTTP/1.1) - The requested resource is available only through a proxy, the address for which is provided in the response.

'305_MESSAGE': 'The requested resource is available only through a proxy, the address for which is provided in the response.',
'305_CLASS': classes.REDIRECTION,
USE_PROXY: 305,

@@ -145,2 +201,3 @@ // 306 - No longer used. Originally meant "Subsequent requests should use the specified proxy.

'306_MESSAGE': 'No longer used. Originally meant "Subsequent requests should use the specified proxy.',
'306_CLASS': classes.REDIRECTION,
SWITCH_PROXY: 306,

@@ -151,2 +208,3 @@ // 307 (since HTTP/1.1) - In this case, the request should be repeated with another URI; however, future requests should still use the original URI.

'307_MESSAGE': 'In this case, the request should be repeated with another URI; however, future requests should still use the original URI.',
'307_CLASS': classes.REDIRECTION,
TEMPORARY_REDIRECT: 307,

@@ -157,6 +215,7 @@ // 308 (RFC 7538) - The request and all future requests should be repeated using another URI.

'308_MESSAGE': 'The request and all future requests should be repeated using another URI.',
'308_CLASS': classes.REDIRECTION,
PERMANENT_REDIRECT: 308,
// ## Client Error 4xx
// The request contains bad syntax or cannot be fulfilled.
// Indicates that the client seems to have erred.

@@ -167,2 +226,3 @@ // 400 - The server cannot or will not process the request due to an apparent client error.

'400_MESSAGE': 'The server cannot or will not process the request due to an apparent client error.',
'400_CLASS': classes.CLIENT_ERROR,
BAD_REQUEST: 400,

@@ -173,2 +233,3 @@ // 401 (RFC 7235) - Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.

'401_MESSAGE': 'Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.',
'401_CLASS': classes.CLIENT_ERROR,
UNAUTHORIZED: 401,

@@ -179,2 +240,3 @@ // 402 - Reserved for future use. The original intention was that this code might be used as part of some form of digital cash or micropayment scheme, as proposed for example by GNU Taler, but that has not yet happened, and this code is not usually used.

'402_MESSAGE': 'Reserved for future use. The original intention was that this code might be used as part of some form of digital cash or micropayment scheme, as proposed for example by GNU Taler, but that has not yet happened, and this code is not usually used.',
'402_CLASS': classes.CLIENT_ERROR,
PAYMENT_REQUIRED: 402,

@@ -185,2 +247,3 @@ // 403 - The request was valid, but the server is refusing action.

'403_MESSAGE': 'The request was valid, but the server is refusing action.',
'403_CLASS': classes.CLIENT_ERROR,
FORBIDDEN: 403,

@@ -191,2 +254,3 @@ // 404 - The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.

'404_MESSAGE': 'The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.',
'404_CLASS': classes.CLIENT_ERROR,
NOT_FOUND: 404,

@@ -197,2 +261,3 @@ // 405 - A request method is not supported for the requested resource.

'405_MESSAGE': 'A request method is not supported for the requested resource.',
'405_CLASS': classes.CLIENT_ERROR,
METHOD_NOT_ALLOWED: 405,

@@ -203,2 +268,3 @@ // 406 - The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.

'406_MESSAGE': 'The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.',
'406_CLASS': classes.CLIENT_ERROR,
NOT_ACCEPTABLE: 406,

@@ -209,2 +275,3 @@ // 407 (RFC 7235) - The client must first authenticate itself with the proxy.

'407_MESSAGE': 'The client must first authenticate itself with the proxy.',
'407_CLASS': classes.CLIENT_ERROR,
PROXY_AUTHENTICATION_REQUIRED: 407,

@@ -215,2 +282,3 @@ // 408 - The server timed out waiting for the request.

'408_MESSAGE': 'The server timed out waiting for the request.',
'408_CLASS': classes.CLIENT_ERROR,
REQUEST_TIMEOUT: 408,

@@ -221,2 +289,3 @@ // 409 - Indicates that the request could not be processed because of conflict in the request, such as an edit conflict between multiple simultaneous updates.

'409_MESSAGE': 'Indicates that the request could not be processed because of conflict in the request, such as an edit conflict between multiple simultaneous updates.',
'409_CLASS': classes.CLIENT_ERROR,
CONFLICT: 409,

@@ -227,2 +296,3 @@ // 410 - Indicates that the resource requested is no longer available and will not be available again.

'410_MESSAGE': 'Indicates that the resource requested is no longer available and will not be available again.',
'410_CLASS': classes.CLIENT_ERROR,
GONE: 410,

@@ -233,2 +303,3 @@ // 411 - The request did not specify the length of its content, which is required by the requested resource.

'411_MESSAGE': 'The request did not specify the length of its content, which is required by the requested resource.',
'411_CLASS': classes.CLIENT_ERROR,
LENGTH_REQUIRED: 411,

@@ -239,2 +310,3 @@ // 412 (RFC 7232) - The server does not meet one of the preconditions that the requester put on the request.

'412_MESSAGE': 'The server does not meet one of the preconditions that the requester put on the request.',
'412_CLASS': classes.CLIENT_ERROR,
PRECONDITION_FAILED: 412,

@@ -245,2 +317,3 @@ // 413 (RFC 7231) - The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".

'413_MESSAGE': 'The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".',
'413_CLASS': classes.CLIENT_ERROR,
REQUEST_ENTITY_TOO_LARGE: 413,

@@ -251,2 +324,3 @@ // 414 (RFC 7231) - The URI provided was too long for the server to process.

'414_MESSAGE': 'The URI provided was too long for the server to process.',
'414_CLASS': classes.CLIENT_ERROR,
REQUEST_URI_TOO_LONG: 414,

@@ -257,2 +331,3 @@ // 415 - The request entity has a media type which the server or resource does not support.

'415_MESSAGE': 'The request entity has a media type which the server or resource does not support.',
'415_CLASS': classes.CLIENT_ERROR,
UNSUPPORTED_MEDIA_TYPE: 415,

@@ -263,2 +338,3 @@ // 416 (RFC 7233) - The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.

'416_MESSAGE': 'The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.',
'416_CLASS': classes.CLIENT_ERROR,
REQUESTED_RANGE_NOT_SATISFIABLE: 416,

@@ -269,2 +345,3 @@ // 417 - The server cannot meet the requirements of the Expect request-header field.

'417_MESSAGE': 'The server cannot meet the requirements of the Expect request-header field.',
'417_CLASS': classes.CLIENT_ERROR,
EXPECTATION_FAILED: 417,

@@ -275,2 +352,3 @@ // 418 (RFC 2324, RFC 7168) - Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout. This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.

'418_MESSAGE': 'Any attempt to brew coffee with a teapot should result in the error code "418 I\'m a teapot". The resulting entity body MAY be short and stout.',
'418_CLASS': classes.CLIENT_ERROR,
IM_A_TEAPOT: 418,

@@ -281,2 +359,3 @@ // 421 (RFC 7540) - The request was directed at a server that is not able to produce a response.

'421_MESSAGE': 'The request was directed at a server that is not able to produce a response.',
'421_CLASS': classes.CLIENT_ERROR,
MISDIRECTED_REQUEST: 421,

@@ -287,2 +366,3 @@ // 422 (WebDAV; RFC 4918) - The request was well-formed but was unable to be followed due to semantic errors.

'422_MESSAGE': 'The request was well-formed but was unable to be followed due to semantic errors.',
'422_CLASS': classes.CLIENT_ERROR,
UNPROCESSABLE_ENTITY: 422,

@@ -293,2 +373,3 @@ // 423 (WebDAV; RFC 4918) - The resource that is being accessed is locked.

'423_MESSAGE': 'The resource that is being accessed is locked.',
'423_CLASS': classes.CLIENT_ERROR,
LOCKED: 423,

@@ -299,2 +380,3 @@ // 424 (WebDAV; RFC 4918) - The request failed because it depended on another request and that request failed.

'424_MESSAGE': 'The request failed because it depended on another request and that request failed.',
'424_CLASS': classes.CLIENT_ERROR,
FAILED_DEPENDENCY: 424,

@@ -305,2 +387,3 @@ // 426 - The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.

'426_MESSAGE': 'The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.',
'426_CLASS': classes.CLIENT_ERROR,
UPGRADE_REQUIRED: 426,

@@ -311,2 +394,3 @@ // 428 (RFC 6585) - The origin server requires the request to be conditional.

'428_MESSAGE': 'The origin server requires the request to be conditional.',
'428_CLASS': classes.CLIENT_ERROR,
PRECONDITION_REQUIRED: 428,

@@ -317,2 +401,3 @@ // 429 (RFC 6585) - The user has sent too many requests in a given amount of time.

'429_MESSAGE': 'The user has sent too many requests in a given amount of time.',
'429_CLASS': classes.CLIENT_ERROR,
TOO_MANY_REQUESTS: 429,

@@ -323,2 +408,3 @@ // 431 (RFC 6585) - The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.

'431_MESSAGE': 'The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.',
'431_CLASS': classes.CLIENT_ERROR,
REQUEST_HEADER_FIELDS_TOO_LARGE: 431,

@@ -329,6 +415,7 @@ // 451 (RFC 7725) - A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.

'451_MESSAGE': 'A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.',
'451_CLASS': classes.CLIENT_ERROR,
UNAVAILABLE_FOR_LEGAL_REASONS: 451,
// ## Server Error 5xx
// The server failed to fulfill an apparently valid request.
// Indicates that the server is aware that it has erred or is incapable of performing the requested method.

@@ -339,2 +426,3 @@ // 500 - A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

'500_MESSAGE': 'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.',
'500_CLASS': classes.SERVER_ERROR,
INTERNAL_SERVER_ERROR: 500,

@@ -345,2 +433,3 @@ // 501 - The server either does not recognize the request method, or it lacks the ability to fulfil the request. Usually this implies future availability.

'501_MESSAGE': 'The server either does not recognize the request method, or it lacks the ability to fulfil the request. Usually this implies future availability.',
'501_CLASS': classes.SERVER_ERROR,
NOT_IMPLEMENTED: 501,

@@ -351,2 +440,3 @@ // 502 - The server was acting as a gateway or proxy and received an invalid response from the upstream server.

'502_MESSAGE': 'The server was acting as a gateway or proxy and received an invalid response from the upstream server.',
'502_CLASS': classes.SERVER_ERROR,
BAD_GATEWAY: 502,

@@ -357,2 +447,3 @@ // 503 - The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.

'503_MESSAGE': 'The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.',
'503_CLASS': classes.SERVER_ERROR,
SERVICE_UNAVAILABLE: 503,

@@ -363,2 +454,3 @@ // 504 - The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

'504_MESSAGE': 'The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.',
'504_CLASS': classes.SERVER_ERROR,
GATEWAY_TIMEOUT: 504,

@@ -369,2 +461,3 @@ // 505 - The server does not support the HTTP protocol version used in the request.

'505_MESSAGE': 'The server does not support the HTTP protocol version used in the request.',
'505_CLASS': classes.SERVER_ERROR,
HTTP_VERSION_NOT_SUPPORTED: 505,

@@ -375,2 +468,3 @@ // 506 (RFC 2295) - Transparent content negotiation for the request results in a circular reference.

'506_MESSAGE': 'Transparent content negotiation for the request results in a circular reference.',
'506_CLASS': classes.SERVER_ERROR,
VARIANT_ALSO_NEGOTIATES: 506,

@@ -381,2 +475,3 @@ // 507 (WebDAV; RFC 4918) - The server is unable to store the representation needed to complete the request.

'507_MESSAGE': 'The server is unable to store the representation needed to complete the request.',
'507_CLASS': classes.SERVER_ERROR,
INSUFFICIENT_STORAGE: 507,

@@ -387,2 +482,3 @@ // 508 (WebDAV; RFC 5842) - The server detected an infinite loop while processing the request.

'508_MESSAGE': 'The server detected an infinite loop while processing the request.',
'508_CLASS': classes.SERVER_ERROR,
LOOP_DETECTED: 508,

@@ -393,2 +489,3 @@ // 510 (RFC 2774) - Further extensions to the request are required for the server to fulfil it.

'510_MESSAGE': 'Further extensions to the request are required for the server to fulfil it.',
'510_CLASS': classes.SERVER_ERROR,
NOT_EXTENDED: 510,

@@ -399,2 +496,3 @@ // 511 (RFC 6585) - The client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network.

'511_MESSAGE': 'The client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network.',
'511_CLASS': classes.SERVER_ERROR,
NETWORK_AUTHENTICATION_REQUIRED: 511,

@@ -413,2 +511,3 @@ // ## Extra code

'103_MESSAGE': 'Used in the resumable requests proposal to resume aborted PUT or POST requests.',
'103_CLASS': classes.INFORMATIONAL,
CHECKPOINT: 103,

@@ -419,2 +518,3 @@ // 419 Page Expired (Laravel Framework) - Used by the Laravel Framework when a CSRF Token is missing or expired.

'419_MESSAGE': 'Used by the Laravel Framework when a CSRF Token is missing or expired.',
'419_CLASS': classes.CLIENT_ERROR,
PAGE_EXPIRED: 419,

@@ -425,2 +525,3 @@ // 218 This is fine (Apache Web Server) - Used as a catch-all error condition for allowing response bodies to flow through Apache when ProxyErrorOverride is enabled. When ProxyErrorOverride is enabled in Apache, response bodies that contain a status code of 4xx or 5xx are automatically discarded by Apache in favor of a generic response or a custom response specified by the ErrorDocument directive.

'218_MESSAGE': 'Used as a catch-all error condition for allowing response bodies to flow through Apache when ProxyErrorOverride is enabled. When ProxyErrorOverride is enabled in Apache, response bodies that contain a status code of 4xx or 5xx are automatically discarded by Apache in favor of a generic response or a custom response specified by the ErrorDocument directive.',
'218_CLASS': classes.SUCCESSFUL,
THIS_IS_FINE: 218,

@@ -431,2 +532,3 @@ // 420 Enhance Your Calm (Twitter) - Returned by version 1 of the Twitter Search and Trends API when the client is being rate limited; versions 1.1 and later use the 429 Too Many Requests response code instead.

'420_MESSAGE': 'Returned by version 1 of the Twitter Search and Trends API when the client is being rate limited; versions 1.1 and later use the 429 Too Many Requests response code instead.',
'420_CLASS': classes.CLIENT_ERROR,
ENHANCE_YOUR_CALM: 420,

@@ -437,2 +539,3 @@ // 450 Blocked by Windows Parental (Microsoft) - The Microsoft extension code indicated when Windows Parental Controls are turned on and are blocking access to the requested webpage.

'450_MESSAGE': 'The Microsoft extension code indicated when Windows Parental Controls are turned on and are blocking access to the requested webpage.',
'450_CLASS': classes.CLIENT_ERROR,
BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS: 450,

@@ -443,2 +546,3 @@ // 498 Invalid Token (Esri) - Returned by ArcGIS for Server. Code 498 indicates an expired or otherwise invalid token.

'498_MESSAGE': 'Returned by ArcGIS for Server. Code 498 indicates an expired or otherwise invalid token.',
'498_CLASS': classes.CLIENT_ERROR,
INVALID_TOKEN: 498,

@@ -449,2 +553,3 @@ // 499 Token Required (Esri) - Returned by ArcGIS for Server. Code 499 indicates that a token is required but was not submitted.

'499_MESSAGE': 'Returned by ArcGIS for Server. Code 499 indicates that a token is required but was not submitted.',
'499_CLASS': classes.CLIENT_ERROR,
TOKEN_REQUIRED: 499,

@@ -455,2 +560,3 @@ // 509 Bandwidth Limit Exceeded (Apache Web Server/cPanel) - The server has exceeded the bandwidth specified by the server administrator.

'509_MESSAGE': 'The server has exceeded the bandwidth specified by the server administrator.',
'509_CLASS': classes.SERVER_ERROR,
BANDWIDTH_LIMIT_EXCEEDED: 509,

@@ -461,2 +567,3 @@ // 530 Site is frozen - Used by the Pantheon web platform to indicate a site that has been frozen due to inactivity.

'530_MESSAGE': 'Used by the Pantheon web platform to indicate a site that has been frozen due to inactivity.',
'530_CLASS': classes.SERVER_ERROR,
SITE_IS_FROZEN: 530,

@@ -467,2 +574,3 @@ // 598 (Informal convention) Network read timeout error - Used by some HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy.

'598_MESSAGE': 'Used by some HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy.',
'598_CLASS': classes.SERVER_ERROR,
NETWORK_READ_TIMEOUT_ERROR: 598

@@ -478,2 +586,3 @@ },

'440_MESSAGE': 'The client\'s session has expired and must log in again.',
'440_CLASS': classes.CLIENT_ERROR,
LOGIN_TIME_OUT: 440,

@@ -484,2 +593,3 @@ // 449 - The server cannot honour the request because the user has not provided the required information.

'449_MESSAGE': 'The server cannot honour the request because the user has not provided the required information.',
'449_CLASS': classes.CLIENT_ERROR,
RETRY_WITH: 449,

@@ -490,2 +600,3 @@ // 451 - Used in Exchange ActiveSync when either a more efficient server is available or the server cannot access the users' mailbox.

'451_MESSAGE': 'Used in Exchange ActiveSync when either a more efficient server is available or the server cannot access the users\' mailbox.',
'451_CLASS': classes.CLIENT_ERROR,
REDIRECT: 451

@@ -501,2 +612,3 @@ },

'444_MESSAGE': 'Used internally to instruct the server to return no information to the client and close the connection immediately.',
'444_CLASS': classes.CLIENT_ERROR,
NO_RESPONSE: 444,

@@ -507,2 +619,3 @@ // 494 - Client sent too large request or too long header line.

'494_MESSAGE': 'Client sent too large request or too long header line.',
'494_CLASS': classes.CLIENT_ERROR,
REQUEST_HEADER_TOO_LARGE: 494,

@@ -513,2 +626,3 @@ // 495 - An expansion of the 400 Bad Request response code, used when the client has provided an invalid client certificate.

'495_MESSAGE': 'An expansion of the 400 Bad Request response code, used when the client has provided an invalid client certificate.',
'495_CLASS': classes.CLIENT_ERROR,
SSL_CERTIFICATE_ERROR: 495,

@@ -519,2 +633,3 @@ // 496 - An expansion of the 400 Bad Request response code, used when a client certificate is required but not provided.

'496_MESSAGE': 'An expansion of the 400 Bad Request response code, used when a client certificate is required but not provided.',
'496_CLASS': classes.CLIENT_ERROR,
SSL_CERTIFICATE_REQUIRED: 496,

@@ -525,2 +640,3 @@ // 497 - An expansion of the 400 Bad Request response code, used when the client has made a HTTP request to a port listening for HTTPS requests.

'497_MESSAGE': 'An expansion of the 400 Bad Request response code, used when the client has made a HTTP request to a port listening for HTTPS requests.',
'497_CLASS': classes.CLIENT_ERROR,
HTTP_REQUEST_SENT_TO_HTTPS_PORT: 497,

@@ -531,2 +647,3 @@ // 499 - Used when the client has closed the request before the server could send a response.

'499_MESSAGE': 'Used when the client has closed the request before the server could send a response.',
'499_CLASS': classes.CLIENT_ERROR,
CLIENT_CLOSED_REQUEST: 499

@@ -542,2 +659,3 @@ },

'520_MESSAGE': 'The 520 error is used as a "catch-all response for when the origin server returns something unexpected", listing connection resets, large headers, and empty or invalid responses as common triggers.',
'520_CLASS': classes.SERVER_ERROR,
UNKNOWN_ERROR: 520,

@@ -548,2 +666,3 @@ // 521 - The origin server has refused the connection from Cloudflare.

'521_MESSAGE': 'The origin server has refused the connection from Cloudflare.',
'521_CLASS': classes.SERVER_ERROR,
WEB_SERVER_IS_DOWN: 521,

@@ -554,2 +673,3 @@ // 522 - Cloudflare could not negotiate a TCP handshake with the origin server.

'522_MESSAGE': 'Cloudflare could not negotiate a TCP handshake with the origin server.',
'522_CLASS': classes.SERVER_ERROR,
CONNECTION_TIMED_OUT: 522,

@@ -560,2 +680,3 @@ // 523 - Cloudflare could not reach the origin server.

'523_MESSAGE': 'Cloudflare could not reach the origin server.',
'523_CLASS': classes.SERVER_ERROR,
ORIGIN_IS_UNREACHABLE: 523,

@@ -566,2 +687,3 @@ // 524 - Cloudflare was able to complete a TCP connection to the origin server, but did not receive a timely HTTP response.

'524_MESSAGE': 'Cloudflare was able to complete a TCP connection to the origin server, but did not receive a timely HTTP response.',
'524_CLASS': classes.SERVER_ERROR,
A_TIMEOUT_OCCURRED: 524,

@@ -572,2 +694,3 @@ // 525 - Cloudflare could not negotiate a SSL/TLS handshake with the origin server.

'525_MESSAGE': 'Cloudflare could not negotiate a SSL/TLS handshake with the origin server.',
'525_CLASS': classes.SERVER_ERROR,
SSL_HANDSHAKE_FAILED: 525,

@@ -578,2 +701,3 @@ // 526 - Cloudflare could not validate the SSL/TLS certificate that the origin server presented.

'526_MESSAGE': 'Cloudflare could not validate the SSL/TLS certificate that the origin server presented.',
'526_CLASS': classes.SERVER_ERROR,
INVALID_SSL_CERTIFICATE: 526,

@@ -584,2 +708,3 @@ // 527 - Error 527 indicates that the request timed out or failed after the WAN connection had been established.

'527_MESSAGE': 'Error 527 indicates that the request timed out or failed after the WAN connection had been established.',
'527_CLASS': classes.SERVER_ERROR,
RAILGUN_ERROR: 527

@@ -586,0 +711,0 @@ }

// Generated by CoffeeScript 2.3.0
// # NGINX extra status code
// # NGINX extra status codes
// The NGINX web server software expands the 4xx error space to signal issues with the client's request.
// The NGINX web server software expands the 4xx error class to signal issues with the client's request.
var k, ref, status, v;

@@ -6,0 +6,0 @@

// Generated by CoffeeScript 2.3.0
// # Unofficial extra status code
// # Unofficial extra status codes

@@ -4,0 +4,0 @@ // This represent a list of codes which are not specified by any standard.

{
"name": "http-status",
"version": "1.3.2",
"version": "1.4.0",
"description": "Interact with HTTP status code",

@@ -55,4 +55,4 @@ "homepage": "https://github.com/adaltas/node-http-status",

"pretest": "coffee -b -o lib src && cp src/index.d.ts lib",
"test": "mocha test/**/*.coffee"
"test": "mocha \"test/**/*.{coffee,ts}\""
}
}
[![Build Status](https://secure.travis-ci.org/adaltas/node-http-status.png)](http://travis-ci.org/adaltas/node-http-status)
# HTTP Status code for Node
# HTTP Status codes for Node
Utility to interact with HTTP status code.
Utility to interact with HTTP status codes.
## Usage
Once you require this module, you may call it with either an HTTP code or a message name. With an HTTP code, you will get the message name while with a message name you will get an HTTP code. Simple.
Once you require this module, you may call it with either an HTTP code or a message name. With an HTTP code, you will get the message name while with a message name you will get an HTTP code.
Additionally, HTTP code names and messages are respectively accessible with the name "{code}_NAME" and "{code}_MESSAGE".
### HTTP Status Codes
HTTP code names, messages, and classes are respectively accessible with the property `{code}_NAME`, `{code}_MESSAGE` and `{code}_CLASS`. This includes all statuses in the [IANA HTTP Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml), with the only addition being `418 I'm a teapot`.
Extra status code are also made available. They are grouped by categories. Specific properties are exported by `http-status` under the property `extra` followed by the category name. Also, extra code are merge with regular status code and made available as modules available inside `http-status/lib/{category}`. Available categories are:
Extra status code are also made available that are not defined in the IANA registry, but used by popular software. They are grouped by category. Specific properties are exported by `http-status` under the property `extra` followed by the category name. Also, extra codes are merge with regular status codes and made available as modules available inside `http-status/lib/{category}`.
- `unofficial`
This represent a list of codes which are not specified by any standard.
- `iis`
Microsoft's Internet Information Services (IIS) web server expands the 4xx error space to signal errors with the client's request.
- `nginx`
The NGINX web server software expands the 4xx error space to signal issues with the client's request.
- `cloudflare`
Cloudflare's reverse proxy service expands the 5xx series of errors space to signal issues with the origin server.
Available categories are:
<dl>
<dt><code>unofficial</code></dt>
<dd>This represent a list of codes which are not specified by any standard.</dd>
<dt><code>iis</code></dt>
<dd>Microsoft's Internet Information Services (IIS) web server expands the 4xx error class to signal errors with the client's request.</dd>
<dt><code>nginx</code></dt>
<dd>The NGINX web server software expands the 4xx error class to signal issues with the client's request.</dd>
<dt><code>cloudflare</code></dt>
<dd>Cloudflare's reverse proxy service expands the 5xx error class to signal issues with the origin server.</dd>
</dl>
### HTTP Status Code Classes
In addition to HTTP status codes, this module also contains status code classes under the `classes` property. Similar to HTTP codes, you can access class names and messages with the property `{class}_NAME` and `{class}_MESSAGE`
## API
This module is very simple. A documentation would be more complicate than reading the [original code](./src/index.litcoffee).
The API is structured as follows:
### API sample
```
100
100_NAME
100_MESSAGE
100_CLASS
CONTINUE
101
101_NAME
101_MESSAGE
101_CLASS
SWITCHING_PROTOCOLS
classes.
├── 1xx
├── 1xx_NAME
├── 1xx_MESSAGE
├── INFORMATIONAL
├── 2xx
├── 2xx_NAME
├── 2xx_MESSAGE
├── SUCCESSFUL
├── …
extra.
├── unofficial.
│ ├── 103
│ ├── 103_NAME
│ ├── 103_MESSAGE
│ ├── 103_CLASS
│ ├── CHECKPOINT
│ ├── …
├── iis.
│ ├── 440
│ ├── 440_NAME
│ ├── 440_MESSAGE
│ ├── 440_CLASS
│ ├── LOGIN_TIME_OUT
│ ├── …
├── nginx.
│ ├── 444
│ ├── 444_NAME
│ ├── 444_MESSAGE
│ ├── 444_CLASS
│ ├── NO_RESPONSE
│ ├── …
├── cloudflare.
│ ├── 520
│ ├── 520_NAME
│ ├── 520_MESSAGE
│ ├── 520_CLASS
│ ├── UNKNOWN_ERROR
│ ├── …
```
For additional information, please refer to [original code](./src/index.litcoffee).
### Example Usage
```javascript
const status = require('http-status');
// Print "Internal Server Error"
console.info(status.INTERNAL_SERVER_ERROR);
// Output: 500
console.info(status[500]);
// Print 500
console.info(status.INTERNAL_SERVER_ERROR);
// Print "INTERNAL_SERVER_ERROR"
console.info(status[status.INTERNAL_SERVER_ERROR]);
// Both output: "Internal Server Error"
console.info(status['500_CODE']);
// Print "A generic error message, given when an unexpected condition was encountered and no more specific message is suitable."
console.info(status[`${status.INTERNAL_SERVER_ERROR}_CODE`]);
// Both output: "INTERNAL_SERVER_ERROR"
console.info(status['500_MESSAGE']);
console.info(status[`${status.INTERNAL_SERVER_ERROR}_MESSAGE`]);
// Both output: "A generic error message, given when an unexpected condition was encountered and no more specific message is suitable."
console.info(status['500_CLASS']);
console.info(status[`${status.INTERNAL_SERVER_ERROR}_CLASS`]);
// Both output: "5xx"
```
### Extra sample
### Example using `classes`
```javascript
const status = require('http-status');
const responseCode = status.INTERNAL_SERVER_ERROR;
switch (status[`${responseCode}_CLASS`]) {
case status.classes.INFORMATIONAL:
// The responseCode is 1xx
break;
case status.classes.SUCCESSFUL:
// The responseCode is 2xx
break;
case status.classes.REDIRECTION:
// The responseCode is 3xx
break;
case status.classes.CLIENT_ERROR:
// The responseCode is 4xx
break;
case status.classes.SERVER_ERROR:
// The responseCode is 5xx
break;
default:
// Unknown
break;
}
```
### Example Using `extra` Property
```javascript
// Accessing property from the NGINX category

@@ -54,14 +159,14 @@ const status = require('http-status');

### Express sample
### Express Example
```javascript
const express = require('express'),
redis = require('redis'),
status = require('http-status');
redis = require('redis'),
status = require('http-status');
// New Express HTTP server
const app = express.createServer();
// Regster a route
app.get('/', function (req, res) {
app.get('/', (req, res) => {
const client = redis.createClient();
client.ping(function (err, msg) {
client.ping((err, msg) => {
if (err) {

@@ -83,3 +188,4 @@ return res.send(status.INTERNAL_SERVER_ERROR);

- Paul Vollmer: <paul.vollmer@fh-potsdam.de>
- James Barcellano: <https://github.com/ckeboss>
This package is developed by [Adaltas](http://www.adaltas.com).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc