Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
Fix duplication of headers containing more than one :
Browse files Browse the repository at this point in the history
The previous behaviour where `$pos` matched on the last occurrence of a colon was breaking for headers like `Expires` that contain colons in the value of the header. As such we were passing a value like "Expires: Tue, 27 Sep 2016 09:" to header_remove(), which resutled in the header not actually being removed.

This caused duplication of headers later when getResponse() added another Expires header.
  • Loading branch information
Keith Moss authored and bsvensson committed Feb 6, 2018
1 parent c16ee9d commit f54171f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PHP/proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public function getResponse()
// headers_list() - Returns a list of response headers sent (or ready to send)
foreach(headers_list() as $key => $value)
{
$pos = strripos($value, ":");
$pos = stripos($value, ":");

$header_type = substr($value,0,$pos);

Expand Down

0 comments on commit f54171f

Please sign in to comment.