Fixed InvalidArgumentException: Status code must be an integer value between 1xx and 5xx

Affected version
2.1.4

MilkyMeda

Member
Any Linkedin link, including a sublink will give you an error loading in unfurl: https://www.linkedin.com/company/

Code:
src/vendor/guzzlehttp/psr7/src/Response.php:151

#0 src/vendor/guzzlehttp/psr7/src/Response.php(98): GuzzleHttp\Psr7\Response->assertStatusCodeRange(999)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php(81): GuzzleHttp\Psr7\Response->__construct(999, Array, Object(XF\Http\Stream), '1.1', 'Request denied')
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(545): GuzzleHttp\Handler\EasyHandle->createResponse()
#3 [internal function]: GuzzleHttp\Handler\CurlFactory->GuzzleHttp\Handler\{closure}(Resource id #96, '
')
#4 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(40): curl_exec(Resource id #96)
#5 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(37): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(54): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/Middleware.php(58): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(125): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#13 src/vendor/guzzlehttp/guzzle/src/Client.php(131): GuzzleHttp\Client->requestAsync('get', Object(GuzzleHttp\Psr7\Uri), Array)
#14 src/XF/Http/Reader.php(365): GuzzleHttp\Client->request('get', 'https://tr.link...', Array)
#15 src/XF/Http/Reader.php(110): XF\Http\Reader->_request(Object(GuzzleHttp\Client), 'get', 'https://tr.link...', Array, Object(XF\Http\Stream), Array, NULL)
#16 src/XF/Http/Reader.php(79): XF\Http\Reader->requestUntrusted('get', 'https://tr.link...', Array, NULL, Array, NULL)
#17 src/XF/Http/MetadataFetcher.php(54): XF\Http\Reader->getUntrusted('https://tr.link...', Array, NULL, Array, NULL)
#18 src/XF/Service/Unfurl/Fetcher.php(22): XF\Http\MetadataFetcher->fetch('https://tr.link...', NULL)
#19 unfurl.php(57): XF\Service\Unfurl\Fetcher->fetch()
#20 {main}
 
Last edited by a moderator:

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.5).

Change log:
Add a further failover catch for when sites sent totally bonkers HTTP headers back to Guzzle for reasons best known to themelves....
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top