Reputation: 43
I am doing a symfony application an I have this return in a route.
$response = new RedirectResponse($url, 302);
$response->headers->set(
'Authorization', 'JWT ' . $this->jwt );
return $response;
The problem is that when I launch this code at the browser I don't have the Authorization header in the response.
If I launch with curl in the same route found, I recibe the header. I don't now the reason.
Upvotes: 0
Views: 1633
Reputation: 3047
Custom headers cannot be sent with a redirect, see Redirect to page and send custom HTTP headers for full details.
Upvotes: 1