setting header before redirect
Hello everyone, I have two simple Dancer 1 apps, I'm creating a specific header in one, and then redirecting to the other application. I would expect to find the custom header in the second application, but I don't see it. I'm also using Data::Dumper to view the request in the second application and I don't find the header there either. Here's the route for both applications: http://paste.perldancer.org/PtkO0HkfPev Am i doing something wrong? Any insight would be appreciated. Thank you in advance nrc
On 03/12/13 17:29, Nuno Carvalho wrote:
Hello everyone,
I have two simple Dancer 1 apps, I'm creating a specific header in one, and then redirecting to the other application. I would expect to find the custom header in the second application, but I don't see it. I'm also using Data::Dumper to view the request in the second application and I don't find the header there either. Here's the route for both applications:
http://paste.perldancer.org/PtkO0HkfPev
Am i doing something wrong? Any insight would be appreciated.
The redirect is issued to the browser. It then loads the new URL. So - the header goes back to the browser, not to the handler of the second request. -- Richard Huxton Archonet Ltd
Nuno, "header" sends your customized header to the browser and redirect probably send a Location: with the new address. Naturally the browser will not "forward" received headers from a server to another URL. On Tue, Dec 3, 2013 at 5:29 PM, Nuno Carvalho <smash@cpan.org> wrote:
Hello everyone,
I have two simple Dancer 1 apps, I'm creating a specific header in one, and then redirecting to the other application. I would expect to find the custom header in the second application, but I don't see it. I'm also using Data::Dumper to view the request in the second application and I don't find the header there either. Here's the route for both applications:
http://paste.perldancer.org/PtkO0HkfPev
Am i doing something wrong? Any insight would be appreciated.
Thank you in advance nrc _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
Hello Richard, Paulo, Makes sense, I can't expect the browser to forward the custom headers on the redirect call. Thank you On Tue, Dec 3, 2013 at 5:38 PM, Paulo A Ferreira <paulo.a.ferreira@gmail.com> wrote:
Nuno,
"header" sends your customized header to the browser and redirect probably send a Location: with the new address. Naturally the browser will not "forward" received headers from a server to another URL.
On Tue, Dec 3, 2013 at 5:29 PM, Nuno Carvalho <smash@cpan.org> wrote:
Hello everyone,
I have two simple Dancer 1 apps, I'm creating a specific header in one, and then redirecting to the other application. I would expect to find the custom header in the second application, but I don't see it. I'm also using Data::Dumper to view the request in the second application and I don't find the header there either. Here's the route for both applications:
http://paste.perldancer.org/PtkO0HkfPev
Am i doing something wrong? Any insight would be appreciated.
Thank you in advance nrc _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (3)
-
Nuno Carvalho -
Paulo A Ferreira -
Richard Huxton