From 2d9456e3e61cf969d5cd11ad85484aa961844ff6 Mon Sep 17 00:00:00 2001 From: jomo Date: Sat, 11 Jul 2015 02:01:52 +0200 Subject: [PATCH] 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: https://github.com/nodejs/io.js/pull/1470 Reviewed-By: Brendan Ashworth Reviewed-By: Ben Noordhuis Reviewed-By: Brian White Reviewed-By: James M Snell --- lib/_http_server.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/_http_server.js b/lib/_http_server.js index 59ea2bdda4d2e1..1a4bd7555a5ccb 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -27,9 +27,11 @@ const STATUS_CODES = exports.STATUS_CODES = { 205 : 'Reset Content', 206 : 'Partial Content', 207 : 'Multi-Status', // RFC 4918 + 208 : 'Already Reported', + 226 : 'IM Used', 300 : 'Multiple Choices', 301 : 'Moved Permanently', - 302 : 'Moved Temporarily', + 302 : 'Found', 303 : 'See Other', 304 : 'Not Modified', 305 : 'Use Proxy', @@ -43,17 +45,18 @@ const STATUS_CODES = exports.STATUS_CODES = { 405 : 'Method Not Allowed', 406 : 'Not Acceptable', 407 : 'Proxy Authentication Required', - 408 : 'Request Time-out', + 408 : 'Request Timeout', 409 : 'Conflict', 410 : 'Gone', 411 : 'Length Required', 412 : 'Precondition Failed', - 413 : 'Request Entity Too Large', - 414 : 'Request-URI Too Large', + 413 : 'Payload Too Large', + 414 : 'URI Too Long', 415 : 'Unsupported Media Type', - 416 : 'Requested Range Not Satisfiable', + 416 : 'Range Not Satisfiable', 417 : 'Expectation Failed', 418 : 'I\'m a teapot', // RFC 2324 + 421 : 'Misdirected Request', 422 : 'Unprocessable Entity', // RFC 4918 423 : 'Locked', // RFC 4918 424 : 'Failed Dependency', // RFC 4918 @@ -66,10 +69,11 @@ const STATUS_CODES = exports.STATUS_CODES = { 501 : 'Not Implemented', 502 : 'Bad Gateway', 503 : 'Service Unavailable', - 504 : 'Gateway Time-out', + 504 : 'Gateway Timeout', 505 : 'HTTP Version Not Supported', 506 : 'Variant Also Negotiates', // RFC 2295 507 : 'Insufficient Storage', // RFC 4918 + 508 : 'Loop Detected', 509 : 'Bandwidth Limit Exceeded', 510 : 'Not Extended', // RFC 2774 511 : 'Network Authentication Required' // RFC 6585