[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

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