Skip to content

Commit 3dc2244

Browse files
committed
bug symfony#16588 Sent out a status text for unknown HTTP headers. (dawehner)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes symfony#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.
2 parents f11e2e9 + eec6fbc commit 3dc2244

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/HttpFoundation/Response.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public function setStatusCode($code, $text = null)
412412
}
413413

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

417417
return $this;
418418
}

src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public function getStatusCodeFixtures()
647647
array('200', null, 'OK'),
648648
array('200', false, ''),
649649
array('200', 'foo', 'foo'),
650-
array('199', null, ''),
650+
array('199', null, 'unknown status'),
651651
array('199', false, ''),
652652
array('199', 'foo', 'foo'),
653653
);

0 commit comments

Comments
 (0)