Thanks for the swift response. Wonder why they don't allow that. Simply (quickly hacking) the HTTP::Server::Simple code to add |OPTIONS to the regex deciding if the request would be accepted fixed the problem. Can I override the default web server used by Dancer in development (i.e. to a subclass of it)? It's a bit annoying that the default web server for Dancer doesn't support one of its route types!
-- Rik Brown http://www.rikbrown.co.uk On Friday, 28 December 2012 at 19:08, Alex C wrote: > That response is coming from HTTP::Server::Simple, Dancer's built-in > development web server, which does not appear to support the OPTIONS request > method. > > http://search.cpan.org/~jesse/HTTP-Server-Simple-0.44/lib/HTTP/Server/Simple.pm#valid_http_method%28$method%29 > > On 28 December 2012 18:56, Rik Brown <[email protected] > (mailto:[email protected])> wrote: > > Hi all, > > > > I'm playing with implementing an OPTIONS route. > > > > The following code: > > > > options '/' => sub { > > return { something => 1 } > > } > > > > returns this: > > <html> > > <head> > > <title>Bad Request</title> > > </head> > > <body> > > <h1>Bad Request</h1> > > <p>Your browser sent a request which this web server could not > > grok.</p> > > </body> > > </html> > > > > - whereas if the Dancer code is switched to 'get' and a GET is used, it > > works fine. > > > > This request doesn't even seem to be hitting my Dancer app (just running > > through myapp.pl (http://myapp.pl) right now) - no entries in the log, even > > on 'core' level. > > > > Does anyone have any thoughts before I dig further? > > > > Cheers, > > Rik > > > > > > -- > > Rik Brown > > http://www.rikbrown.co.uk > > > > > > _______________________________________________ > > dancer-users mailing list > > [email protected] (mailto:[email protected]) > > http://lists.preshweb.co.uk/mailman/listinfo/dancer-users > > > > _______________________________________________ > dancer-users mailing list > [email protected] (mailto:[email protected]) > http://lists.preshweb.co.uk/mailman/listinfo/dancer-users > >
_______________________________________________ dancer-users mailing list [email protected] http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
