Skip to content

Commit

Permalink
[TASK] Add missing HTTP status code presets for PSR-7 responses
Browse files Browse the repository at this point in the history
They've been synched from the list of status codes at:
http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

This patch also corrects some misspelled reason phrases.

Change-Id: I993d851d6ac5dc5fb2538149d1e399aed62227ad
Releases: master, 8.7
Resolves: #84490
Related: #84481
Reviewed-on: https://review.typo3.org/56375
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
  • Loading branch information
bnf authored and NeoBlack committed Apr 5, 2018
1 parent 8d457a6 commit f259a21
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions typo3/sysext/core/Classes/Http/Response.php
Expand Up @@ -47,6 +47,7 @@ class Response extends Message implements ResponseInterface
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
103 => 'Early Hints',
// SUCCESS CODES
200 => 'OK',
201 => 'Created',
Expand All @@ -55,8 +56,9 @@ class Response extends Message implements ResponseInterface
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
207 => 'Multi-status',
207 => 'Multi-Status',
208 => 'Already Reported',
226 => 'IM Used',
// REDIRECTION CODES
300 => 'Multiple Choices',
301 => 'Moved Permanently',
Expand All @@ -66,6 +68,7 @@ class Response extends Message implements ResponseInterface
305 => 'Use Proxy',
306 => 'Switch Proxy', // Deprecated
307 => 'Temporary Redirect',
308 => 'Permanent Redirect',
// CLIENT ERROR
400 => 'Bad Request',
401 => 'Unauthorized',
Expand All @@ -75,17 +78,18 @@ class Response extends Message implements ResponseInterface
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',
421 => 'Misdirected Request',
422 => 'Unprocessable Entity',
423 => 'Locked',
424 => 'Failed Dependency',
Expand All @@ -94,17 +98,19 @@ class Response extends Message implements ResponseInterface
428 => 'Precondition Required',
429 => 'Too Many Requests',
431 => 'Request Header Fields Too Large',
451 => 'Unavailable For Legal Reasons',
// SERVER ERROR
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Time-out',
505 => 'HTTP Version not supported',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported',
506 => 'Variant Also Negotiates',
507 => 'Insufficient Storage',
508 => 'Loop Detected',
509 => 'Bandwidth Limit Exceeded',
510 => 'Not Extended',
511 => 'Network Authentication Required'
];

Expand Down

0 comments on commit f259a21

Please sign in to comment.