Skip to content

Commit 76aac71

Browse files
committed
fix: trim header name and value
1 parent 2fd7686 commit 76aac71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

system/HTTP/CURLRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ protected function setResponseHeaders(array $headers = [])
479479
{
480480
foreach ($headers as $header) {
481481
if (($pos = strpos($header, ':')) !== false) {
482-
$title = substr($header, 0, $pos);
483-
$value = substr($header, $pos + 1);
482+
$title = trim(substr($header, 0, $pos));
483+
$value = trim(substr($header, $pos + 1));
484484

485485
$this->response->addHeader($title, $value);
486486
} elseif (strpos($header, 'HTTP') === 0) {

0 commit comments

Comments
 (0)