Using Dancer's Request HTTP Env shortcuts
As I was working on a small application that allowed editing of pages, I really wanted to grab the referring page to redirect after the page was updated or the edit session was cancelled by the user.
It wasn't very clear to me how to grab the referer from Dancer's POD documentation on Dancer::Request.
Basically I could grab it either of 2 ways.
In the end it is much easier and I think prettier than the several options I tried :)
__END__
It wasn't very clear to me how to grab the referer from Dancer's POD documentation on Dancer::Request.
Basically I could grab it either of 2 ways.
- request->referer - nice. This applies to other env options as well forwarded_for_address which pulls in X_FORWARDED_FOR
- request->env->{HTTP_REFERER} - feels more lower level.
In the end it is much easier and I think prettier than the several options I tried :)
__END__
Comments
Post a Comment