Open
Description
Summary
This problem was previously discussed in 2016 in #161 , but at this point in time it might be worth revisiting. As stated in that issue, LinkedIn will return the nonstandard HTTP status code of 999 for many requests. The workaround suggested relates to code that has changed since 2016.
At a minimum, could updated syntax for how passing the ACCEPT_ENCODING should be used in the CurlClient()
class. Something along the lines of the following?
$client = new CurlClient();
$client->setSettings([
'user_agent' => 'Mozilla',
'httpheader' => [
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Enconding' => 'gzip, deflate, sdch'
],
]);
$embed = new Embed(new Crawler($client));
Alternatively, a simple intervention could be done by this library by substituting the nonstandard 999 Forbidden for 403 Forbidden in CurlDispatcher:
$response = $responseFactory->createResponse($info['http_code']);
+ if ($info['http_code'] === 999) [
+ $info['http_code'] = 403;
+ ]
foreach ($this->headers as $header) {
list($name, $value) = $header;
$response = $response->withAddedHeader($name, $value);
}
Metadata
Metadata
Assignees
Labels
No labels