$http = JHttpFactory::getHttp(new JRegistry,'socket');
$response = $http->get(JURI::root(), [], 1 );
var_dump($response);
//JURI::root() redirects to JURI::root() . '/en/';
response of the final destination
joomla error
utf8_decode(): Argument ($string) must be of type string, array given (JROOT/libraries/vendor/joomla/uri/src/UriHelper.php:42)
SocketTransport::request class itself with $content->headers['Location'] however $content->headers['Location'] is an array.
the new Uri($content->headers['Location']) then fails, using getHeaderLine solves the issue
// Follow Http redirects
if ($content->code >= 301 && $content->code < 400 && isset($content->headers['Location'])) {
return $this->request($method, new Uri($content->getHeaderLine('location')), $data, $headers, $timeout, $userAgent);
}
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
Labels |
Added:
PBF
|
Labels |
Removed:
PBF
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-07-07 20:27:16 |
Closed_By | ⇒ | brbrbr |
Solved in #43734