does not support OPTIONS verb #523

MarkHofstetter opened this Issue Jan 12, 2014 · 2 comments

3 participants


package testopt;
use Dancer2;

our $VERSION = '0.1';

options '/test' => sub {


then run bin/

curl -v -H "Accept: application/json" -X OPTIONS
< HTTP/1.0 400 Bad request

Your browser sent a request which this web server could not grok.


running the same lib with
plackup --port 3000 bin/
everthing works


Dancer2 uses HTTP::Server::Simple::PSGI when run via bin/, it's that (HTTP::Server::Simple) that doesn't support OPTIONS
plackup uses HTTP::Server::PSGI by default which does.
This isn't really a Dancer2 issue.

PerlDancer member

The HTTP::Server::Simple docs are fairly clear about how to extend the allowed methods.

Since Dancer2::Core::Server::Standalone is a subclass of HTTP::Server::Simple, its reasonable that it provides its own valid_http_method to allow OPTIONS, which aligns the DSL request methods to what the server classes support. I'll put a Pr together for this soon.

@racke racke closed this in #535 Mar 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment