fix(network): align HTTP status codes with IANA (#4567)

Aline HTTP status texts with https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
This commit is contained in:
Andrey Lushnikov 2019-06-10 21:04:45 -07:00 committed by GitHub
parent 792264122c
commit 6860d73212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -728,19 +728,22 @@ function headersArray(headers) {
return result; return result;
} }
// List taken from https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml with extra 306 and 418 codes.
const STATUS_TEXTS = { const STATUS_TEXTS = {
'100': 'Continue', '100': 'Continue',
'101': 'Switching Protocols', '101': 'Switching Protocols',
'102': 'Processing', '102': 'Processing',
'103': 'Early Hints',
'200': 'OK', '200': 'OK',
'201': 'Created', '201': 'Created',
'202': 'Accepted', '202': 'Accepted',
'203': 'Non-Authoritative Information', '203': 'Non-Authoritative Information',
'204': 'No Content', '204': 'No Content',
'205': 'Reset Content',
'206': 'Partial Content', '206': 'Partial Content',
'207': 'Multi-Status', '207': 'Multi-Status',
'208': 'Already Reported', '208': 'Already Reported',
'209': 'IM Used', '226': 'IM Used',
'300': 'Multiple Choices', '300': 'Multiple Choices',
'301': 'Moved Permanently', '301': 'Moved Permanently',
'302': 'Found', '302': 'Found',
@ -773,6 +776,7 @@ const STATUS_TEXTS = {
'422': 'Unprocessable Entity', '422': 'Unprocessable Entity',
'423': 'Locked', '423': 'Locked',
'424': 'Failed Dependency', '424': 'Failed Dependency',
'425': 'Too Early',
'426': 'Upgrade Required', '426': 'Upgrade Required',
'428': 'Precondition Required', '428': 'Precondition Required',
'429': 'Too Many Requests', '429': 'Too Many Requests',