Skip to content

Commit

Permalink
Fix validateHttpVersion to be RFC 1945 and RFC 7230 compliant (#4368)
Browse files Browse the repository at this point in the history
* Fix deprecated message for strlen first value null

* Fix validateHttpVersion to be RFC 1945 and RFC 7230 compliant
  • Loading branch information
leissbua authored Nov 24, 2024
1 parent 7e75322 commit 41ea3c6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/Mage/HTTP/Client/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,7 @@ protected function parseHeaders($ch, $data): int
*/
protected function validateHttpVersion(array $line)
{
if ($line[0] === 'HTTP/1.0' || $line[0] === 'HTTP/1.1') {
if (count($line) !== 3) {
$this->doError('Invalid response line returned from server: ' . implode(' ', $line));
}

return;
}

if ($line[0] === 'HTTP/2') {
if (in_array($line[0], ['HTTP/2', 'HTTP/1.0', 'HTTP/1.1'])) {
if (!in_array(count($line), [2, 3])) {
$this->doError('Invalid response line returned from server: ' . implode(' ', $line));
}
Expand Down

0 comments on commit 41ea3c6

Please sign in to comment.