fix download large file for map download

This commit is contained in:
Beu
2025-07-25 21:49:05 +02:00
parent 1fb7c87925
commit ee0b0ac166
6 changed files with 222 additions and 134 deletions

View File

@@ -19,18 +19,7 @@ class Response
$this->ch = $request->getHandle();
if ($content != null) {
$header_size = $this->getInfo(CURLINFO_HEADER_SIZE);
foreach (explode("\r\n", substr($content, 0, $header_size)) as $value) {
if(false !== ($matches = explode(':', $value, 2))) {
if (count($matches) === 2) {
$headers_arr["{$matches[0]}"] = trim($matches[1]);
}
}
}
$this->headers = $headers_arr;
$this->content = substr($content, $header_size);
$this->content = $content;
}
}
@@ -89,6 +78,17 @@ class Response
return isset($this->error);
}
/**
* Sets headers
*
* @param array $error headers to set
* @return void
*/
public function setHeaders(array $headers)
{
$this->headers = $headers;
}
/**
* Returns headers of request
*