<div>Thanks for the swift response.</div><div><br></div><div>
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.</div><div>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! </div>
<div><div><br></div><div>-- </div><div>Rik Brown</div><div>http://www.rikbrown.co.uk</div><div><br></div></div>
<p style="color: #A0A0A8;">On Friday, 28 December 2012 at 19:08, Alex C wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>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>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 type="cite"><div>
<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><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></div></blockquote></div><br></div></div>
</div><div><div>_______________________________________________</div><div>dancer-users mailing list</div><div><a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a></div><div><a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>