[Dancer-users] Browser String not available when run with plackup

Gurunandan Bhat gbhat at pobox.com
Wed Jul 20 15:06:12 CEST 2011


Thanks David.  *request->user_agent* works in both cases (with Dancer's
backend as well as with plackup).

Would appreciate understanding why using %ENV for this is not a good idea.




On Wed, Jul 20, 2011 at 3:11 AM, David Precious <davidp at preshweb.co.uk>wrote:

> On Wednesday 20 July 2011 06:27:37 Gurunandan Bhat wrote:
> > I want to find the Browser string something that is available with
> > $ENV{HTTP_USER_AGENT}  when I run a Da*ncer app with teh default backend.
> > However when I run the app with plackup (plackup -s Starman app.pl)
> > $ENV{HTTP_USER_AGENT} is undefined.
>
> You're better off using request->user_agent rather than poking around in
> %ENV.
>
>
> > Is there a way I can get to this value that does not depend on how I run
> > the Dancer application?
>
> Please try the above first.  If you find that request->user_agent isn't
> getting you the user agent when run via plackup, something odd is
> happening;
> supplying a dump of request->env may be helpful.
>
>
>
> --
> David Precious  ("bigpresh")
> http://www.preshweb.co.uk/
>
>   "Programming is like sex. One mistake and you have to support
>   it for the rest of your life". (Michael Sinz)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110720/c887a1cb/attachment.htm>


More information about the Dancer-users mailing list