The Request.accept method must support wildcard #183

Closed
cescoffier opened this Issue Apr 22, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@cescoffier
Member

cescoffier commented Apr 22, 2014

For instance, if your controller does:

 @Route(method = HttpMethod.GET, uri = "/accept")
    public Result accept() {
        if (request().accepts("application/json")) {
            return ok("json");
        } else if (request().accepts("text/html")) {
            return ok("html");
        } else {
            return badRequest();
        }
    }

A request with Accept:text/* must return "html".

@cescoffier cescoffier added this to the 0.5 milestone Apr 22, 2014

@cescoffier cescoffier added the bug label May 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment