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

David Precious davidp at preshweb.co.uk
Wed Jul 20 12:11:49 CEST 2011

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")

   "Programming is like sex. One mistake and you have to support
   it for the rest of your life". (Michael Sinz)

More information about the Dancer-users mailing list