Skip to content

Commit

Permalink
Corrected request header split #775 (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerzabek authored Jan 14, 2024
1 parent 43dfccc commit aa693d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Transaction/MultipartDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ public function parseDocuments(): self
list($headers, $body) = array_map('trim', explode("\r\n\r\n", $document, 2));

foreach (explode("\r\n", $headers) as $header) {
list($key, $value) = explode(': ', $header, 2);
list($key, $value) = explode(':', $header, 2);
$key = strtolower($key);
$multipart->headers[$key] = $multipart->headers[$key] ?? [];
$multipart->headers[$key][] = $value;
$multipart->headers[$key][] = trim($value);
}

$multipart->setBody($body);
Expand Down Expand Up @@ -176,9 +176,9 @@ public function toRequest(): Request
break;
}

list($key, $value) = explode(': ', $line, 2);
list($key, $value) = explode(':', $line, 2);

$headers[$key] = $value;
$headers[$key] = trim($value);
}

$body = implode("\r\n", $httpRequest);
Expand All @@ -188,4 +188,4 @@ public function toRequest(): Request

return $request;
}
}
}

0 comments on commit aa693d6

Please sign in to comment.