Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly unexpected 404 vs 405 #124

Open
jonathanstowe opened this issue Feb 9, 2021 · 0 comments
Open

Possibly unexpected 404 vs 405 #124

jonathanstowe opened this issue Feb 9, 2021 · 0 comments

Comments

@jonathanstowe
Copy link
Contributor

With something like:

use Cro::HTTP::Router;
use Cro::HTTP::Server;

sub my-route() {
    route {
        post -> *@a {
            content 'text/plain', 'foo';
        }   
    }   
}

my $app = route {
    get {
        content 'text/plain', 'root';
    }   
    include foo => my-route();
};

my Cro::Service $s = Cro::HTTP::Server.new(:host<localhost>, :port<7798>, application => $app);

$s.start;

react whenever signal(SIGINT) { $s.stop; exit; }

a GET to /foo correctly returns a 405 whereas with /foo/foo it returns 404, however if the get route is removed then it will return 405 for a GET to all /foo/**.

It's entirely possible that it's simply my expectations need adjusting or I missed an important part of the documentation or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant