Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketTransport Location is array #38812

Closed
brbrbr opened this issue Sep 22, 2022 · 1 comment
Closed

SocketTransport Location is array #38812

brbrbr opened this issue Sep 22, 2022 · 1 comment

Comments

@brbrbr
Copy link

brbrbr commented Sep 22, 2022

Steps to reproduce the issue

$http = JHttpFactory::getHttp(new JRegistry,'socket');
$response = $http->get(JURI::root(), [], 1 );
var_dump($response);

//JURI::root() redirects to JURI::root() . '/en/';

Expected result

response of the final destination

Actual result

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);
        }

@brbrbr brbrbr changed the title SocketTransport Location is array SocketTransport Location is array Sep 22, 2022
@Hackwar Hackwar added the bug label Feb 17, 2023
@Hackwar Hackwar added the PBF Pizza, Bugs and Fun label Aug 25, 2023
@brianteeman brianteeman removed the PBF Pizza, Bugs and Fun label Sep 1, 2023
@brbrbr
Copy link
Author

brbrbr commented Jul 7, 2024

Solved in #43734

@brbrbr brbrbr closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants