Skip to content

Commit

Permalink
Correctly match the HTTP header
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp authored and leofeyer committed Apr 2, 2020
1 parent 33c1117 commit 66575d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core-bundle/src/EventListener/MergeHttpHeadersListener.php
Expand Up @@ -144,8 +144,9 @@ private function setResponseHeaders(Response $response)
$allowOverrides = [];

foreach ($this->headers as $header) {
if (preg_match('/^HTTP\/[^ ]* (\d{3}) (.*)$/i', $header, $matches)) {
$response->setStatusCode($matches[1], $matches[2]);
if (preg_match('/^HTTP\/[^ ]+ (\d{3})( (.+))?$/i', $header, $matches)) {
$text = isset($matches[3]) ? $matches[3] : '';
$response->setStatusCode($matches[1], $text);
continue;
}

Expand Down

0 comments on commit 66575d8

Please sign in to comment.