Skip to content

Commit c2ae246

Browse files
authored
Remove proxy response code from response body (#4892)
* Remove proxy response code from response body * update
1 parent f1ae19d commit c2ae246

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Varien/Http/Adapter/Curl.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,14 @@ public function read()
192192
$response = trim($response[1]);
193193
}
194194

195-
if (stripos($response, "Transfer-Encoding: chunked\r\n")) {
196-
$response = str_ireplace("Transfer-Encoding: chunked\r\n", '', $response);
195+
$responsePart = "HTTP/1.1 200 Connection established\r\n";
196+
if (stripos($response, $responsePart) === 0) {
197+
$response = str_ireplace($responsePart, '', $response);
198+
}
199+
200+
$responsePart = "Transfer-Encoding: chunked\r\n";
201+
if (stripos($response, $responsePart)) {
202+
$response = str_ireplace($responsePart, '', $response);
197203
}
198204

199205
return $response;

0 commit comments

Comments
 (0)