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.<div><br></div><div><a href="http://search.cpan.org/~jesse/HTTP-Server-Simple-0.44/lib/HTTP/Server/Simple.pm#valid_http_method%28$method%29">http://search.cpan.org/~jesse/HTTP-Server-Simple-0.44/lib/HTTP/Server/Simple.pm#valid_http_method%28$method%29</a><br>
<div><br><div class="gmail_quote">On 28 December 2012 18:56, Rik Brown <span dir="ltr"><<a href="mailto:rik@rikbrown.co.uk" target="_blank">rik@rikbrown.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
Hi all,
</div><div><br></div><div>I'm playing with implementing an OPTIONS route. </div><div><br></div><div>The following code:</div><div><br></div><div>options '/' => sub {</div><div> return { something => 1 }</div>
<div>}</div><div><br></div><div>returns this:</div><div><div><html></div><div> <head></div><div> <title>Bad Request</title></div><div> </head></div><div> <body></div><div>
<h1>Bad Request</h1></div><div> <p>Your browser sent a request which this web server could not</div><div> grok.</p></div><div> </body></div><div></html></div><div>
<br></div><div>- whereas if the Dancer code is switched to 'get' and a GET is used, it works fine. </div><div><br></div><div>This request doesn't even seem to be hitting my Dancer app (just running through <a href="http://myapp.pl" target="_blank">myapp.pl</a> right now) - no entries in the log, even on 'core' level.</div>
<div><br></div><div>Does anyone have any thoughts before I dig further?</div><div><br></div><div>Cheers,</div><div>Rik</div></div><span class="HOEnZb"><font color="#888888">
<div><div><br></div><div>-- </div><div>Rik Brown</div><div><a href="http://www.rikbrown.co.uk" target="_blank">http://www.rikbrown.co.uk</a></div><div><br></div></div>
</font></span><br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div></div>