Skip to content

Commit 2d9456e

Browse files
jomorvagg
authored andcommitted
http: use official IANA Status Codes
* adds missing HTTP status codes * corrects those with a wrong description * the falsely included codes have been kept PR-URL: #1470 Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ef65321 commit 2d9456e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/_http_server.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ const STATUS_CODES = exports.STATUS_CODES = {
2727
205 : 'Reset Content',
2828
206 : 'Partial Content',
2929
207 : 'Multi-Status', // RFC 4918
30+
208 : 'Already Reported',
31+
226 : 'IM Used',
3032
300 : 'Multiple Choices',
3133
301 : 'Moved Permanently',
32-
302 : 'Moved Temporarily',
34+
302 : 'Found',
3335
303 : 'See Other',
3436
304 : 'Not Modified',
3537
305 : 'Use Proxy',
@@ -43,17 +45,18 @@ const STATUS_CODES = exports.STATUS_CODES = {
4345
405 : 'Method Not Allowed',
4446
406 : 'Not Acceptable',
4547
407 : 'Proxy Authentication Required',
46-
408 : 'Request Time-out',
48+
408 : 'Request Timeout',
4749
409 : 'Conflict',
4850
410 : 'Gone',
4951
411 : 'Length Required',
5052
412 : 'Precondition Failed',
51-
413 : 'Request Entity Too Large',
52-
414 : 'Request-URI Too Large',
53+
413 : 'Payload Too Large',
54+
414 : 'URI Too Long',
5355
415 : 'Unsupported Media Type',
54-
416 : 'Requested Range Not Satisfiable',
56+
416 : 'Range Not Satisfiable',
5557
417 : 'Expectation Failed',
5658
418 : 'I\'m a teapot', // RFC 2324
59+
421 : 'Misdirected Request',
5760
422 : 'Unprocessable Entity', // RFC 4918
5861
423 : 'Locked', // RFC 4918
5962
424 : 'Failed Dependency', // RFC 4918
@@ -66,10 +69,11 @@ const STATUS_CODES = exports.STATUS_CODES = {
6669
501 : 'Not Implemented',
6770
502 : 'Bad Gateway',
6871
503 : 'Service Unavailable',
69-
504 : 'Gateway Time-out',
72+
504 : 'Gateway Timeout',
7073
505 : 'HTTP Version Not Supported',
7174
506 : 'Variant Also Negotiates', // RFC 2295
7275
507 : 'Insufficient Storage', // RFC 4918
76+
508 : 'Loop Detected',
7377
509 : 'Bandwidth Limit Exceeded',
7478
510 : 'Not Extended', // RFC 2774
7579
511 : 'Network Authentication Required' // RFC 6585

0 commit comments

Comments
 (0)