Closed
Description
CodeIgniter4/system/HTTP/CURLRequest.php
Lines 451 to 470 in a18fdea
FIX
$response_header_array = explode("\r\n\r\n", $output);
$response_header = '';
for ($i = count($response_header_array) - 1; $i >= 0; $i--) {
if (stripos($response_header_array[$i], 'HTTP/') === 0) {
$response_header = $response_header_array[$i];
break;
}
}
if (!empty($response_header)){
$headers = explode("\n", $response_header);
$this->setResponseHeaders($headers);
$this->response->setBody(end($response_header_array));
}
Custom header parsing error
**BAD HEADER**
HTTP/1.1 100 Continue ---- **IS NOT** "HTTP/1.1 100 Continue\x0d\x0a\x0d\x0a"
Server: ddos-guard
Set-Cookie: __ddg1=z177j4mLtqzC07v0zviU; Domain=.site.ru; HttpOnly; Path=/; Expires=Wed, 07-Jul-2021 15:13:14 GMT
----- **FIRST** \r\n\r\n Because of this, the headings fall in response to the body
HTTP/1.1 200 OK
Server: ddos-guard
Connection: keep-alive
Keep-Alive: timeout=60
Set-Cookie: __ddg1=z177j4mLtqzC07v0zviU; Domain=.site.ru; HttpOnly; Path=/; Expires=Wed, 07-Jul-2021 15:13:14 GMT
Date: Tue, 07 Jul 2020 15:13:14 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=80pd3hlg38mvjnelpvokp9lad0; path=/
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
------- **TWO** \r\n\r\n
<?xml version="1.0"?> <response><title>Update success! config</title><text>Successfully updated the project settings!</text><status>success</status></response>
Activity