Skip to content

Commit

Permalink
bug #16588 Sent out a status text for unknown HTTP headers. (dawehner)
Browse files Browse the repository at this point in the history
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16588).

Discussion
----------

Sent out a status text for unknown HTTP headers.

* The HTTP RFC explains that header('HTTP/1.1 418 ') should be fine, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
* Apache itself though is broken, see https://gist.github.com/anonymous/a863d7b493c4b09733ec

The fix is to sent out some status text, when we don't know a better text.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

eec6fbc Sent out a status text for unknown HTTP headers.
  • Loading branch information
fabpot committed Nov 19, 2015
2 parents f11e2e9 + eec6fbc commit 3dc2244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Expand Up @@ -412,7 +412,7 @@ public function setStatusCode($code, $text = null)
}

if (null === $text) {
$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : '';
$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : 'unknown status';

return $this;
}
Expand Down
Expand Up @@ -647,7 +647,7 @@ public function getStatusCodeFixtures()
array('200', null, 'OK'),
array('200', false, ''),
array('200', 'foo', 'foo'),
array('199', null, ''),
array('199', null, 'unknown status'),
array('199', false, ''),
array('199', 'foo', 'foo'),
);
Expand Down

0 comments on commit 3dc2244

Please sign in to comment.