[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
1 changed files with 2 additions and 2 deletions

View File

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