Hi,
I have the following problem: if I redirect to a signed s3 url from the php aws sdk v2, the download works fine. If I redirect to a signed s3 url from the php aws sdk v3, the browsers says that there are duplicate "location" response headers.
Is anyone having the same issue? Any workarounds?
I suppose the redirect is sending some headers to the client that are also are sent by the s3 response.
Solved:
$request = $client->createPresignedRequest(...);
// uri is a guzzle uri object
$uri = $request->getUri();
// cast $uri as string
redirect((string)$uri);
You have to explicitly cast the $uri as string. Otherwise you get a Location header for each property of the $uri object, the __toString() method doesn't get called.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community