[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:
parent
edf10be93a
commit
70542686bb
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue