[contents] Fix parsing of incomplete headers

Response headers may contain fields with no values.

Example:
  "Referrer-Policy: "

In this case the current implementation of explode() results in an
error because there is no content after ": ". Changing the delimiter
to ":" and trimming the value manually fixes that issue.
This commit is contained in:
logmanoriginal 2019-06-09 17:07:21 +02:00
parent edf10be93a
commit 70542686bb

View file

@ -322,8 +322,8 @@ function parseResponseHeader($header) {
$header['http_code'] = $line; $header['http_code'] = $line;
} else { } else {
list ($key, $value) = explode(': ', $line); list ($key, $value) = explode(':', $line);
$header[$key] = $value; $header[$key] = trim($value);
} }