fix error using a better way
This commit is contained in:
@@ -115,9 +115,7 @@ class RequestsQueue extends EventDispatcher implements RequestsQueueInterface, \
|
||||
$event = new Event();
|
||||
$event->request = $request;
|
||||
$event->response = new Response($request, curl_multi_getcontent($request->getHandle()));
|
||||
if ($event->request->getResponseHeaders() !== null) {
|
||||
$event->response->setHeaders($event->request->getResponseHeaders());
|
||||
}
|
||||
$event->response->setHeaders($event->request->getResponseHeaders());
|
||||
if ($result !== CURLE_OK) {
|
||||
$event->response->setError(new Error(curl_error($request->getHandle()), $result));
|
||||
}
|
||||
|
@@ -81,10 +81,10 @@ class Response
|
||||
/**
|
||||
* Sets headers
|
||||
*
|
||||
* @param array $error headers to set
|
||||
* @param array|null $headers headers to set
|
||||
* @return void
|
||||
*/
|
||||
public function setHeaders(array $headers)
|
||||
public function setHeaders(?array $headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
}
|
||||
|
Reference in New Issue
Block a user