Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Slim/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,17 @@ class Response extends Message implements ResponseInterface
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
418 => 'I\'m a teapot',
421 => 'Misdirected Request',
422 => 'Unprocessable Entity',
423 => 'Locked',
424 => 'Failed Dependency',
426 => 'Upgrade Required',
428 => 'Precondition Required',
429 => 'Too Many Requests',
431 => 'Request Header Fields Too Large',
444 => 'Connection Closed Without Response',
451 => 'Unavailable For Legal Reasons',
499 => 'Client Closed Request',
//Server Error 5xx
500 => 'Internal Server Error',
501 => 'Not Implemented',
Expand All @@ -111,6 +114,7 @@ class Response extends Message implements ResponseInterface
508 => 'Loop Detected',
510 => 'Not Extended',
511 => 'Network Authentication Required',
599 => 'Network Connect Timeout Error',
];

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Http/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ public function testGetReasonPhrase()
public function testMustSetReasonPhraseForUnrecognisedCode()
{
$response = new Response();
$response = $response->withStatus(499);
$response = $response->withStatus(199);
}

public function testSetReasonPhraseForUnrecognisedCode()
{
$response = new Response();
$response = $response->withStatus(499, 'Authentication timeout');
$response = $response->withStatus(199, 'Random Message');

$this->assertEquals('Authentication timeout', $response->getReasonPhrase());
$this->assertEquals('Random Message', $response->getReasonPhrase());
}

public function testGetCustomReasonPhrase()
Expand Down