Skip to content
Merged
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
44 changes: 27 additions & 17 deletions libraries/src/Application/WebApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,32 @@ class WebApplication extends BaseApplication
*/
private $singleValueResponseHeaders = array(
'status', // This is not a valid header name, but the representation used by Joomla to identify the HTTP Response Code
'Content-Length',
'Host',
'Content-Type',
'Content-Location',
'Date',
'Location',
'Retry-After',
'Server',
'Mime-Version',
'Last-Modified',
'ETag',
'Accept-Ranges',
'Content-Range',
'Age',
'Expires',
'Clear-Site-Data',
'content-length',
'host',
'content-type',
'content-location',
'date',
'location',
'retry-after',
'server',
'mime-version',
'last-modified',
'etag',
'accept-ranges',
'content-range',
'age',
'expires',
'clear-site-data',
'pragma',
'strict-transport-security',
'content-security-policy',
'content-security-policy-report-only',
'x-frame-options',
'x-xss-protection',
'x-content-type-options',
'referrer-policy',
'expect-ct',
'feature-policy',
);

/**
Expand Down Expand Up @@ -740,7 +750,7 @@ public function setHeader($name, $value, $replace = false)
* If ($keys && $replace) it's a replacement and previous have been deleted
* If ($keys && !in_array...) it's a multiple value header
*/
$single = in_array($name, $this->singleValueResponseHeaders);
$single = in_array(strtolower($name), $this->singleValueResponseHeaders);

if ($value && (!$keys || ($keys && ($replace || !$single))))
{
Expand Down