Play should respond to HEAD requests if a GET route exists

Bug #532648 reported by Erwan Loisant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Undecided
Erwan Loisant
1.1
Fix Committed
Undecided
Erwan Loisant
Erwan Loisant (eloisant)
Changed in play:
assignee: nobody → Erwan Loisant (eloisant)
Revision history for this message
Erwan Loisant (eloisant) wrote :
Revision history for this message
dirk (australiandeveloper) wrote :

It seems like this patch doesn't work. I think the problem is that the route is never returned if the request method is a HEAD request. It just continues on to the next line and throws a NotFound.

        // Not found - if the request was a HEAD, let's see if we can find a corresponding GET
        if (request.method.equals("HEAD")) {
            request.method = "GET";
            route(request);
            request.method = "HEAD";
            // *******************
            // There should be a return statement here
            // ******************
        }
        throw new NotFound(request.method, request.path);

Revision history for this message
Nicolas Leroux (nicolas-lunatech) wrote : Re: [Bug 532648] Re: Play should respond to HEAD requests if a GET route exists

Yes, I have already modified the patch and included test cases. Have a look at the latest build.

Nicolas
On 17 mrt 2010, at 17:06, dirk wrote:

> It seems like this patch doesn't work. I think the problem is that the
> route is never returned if the request method is a HEAD request. It just
> continues on to the next line and throws a NotFound.
>
> // Not found - if the request was a HEAD, let's see if we can find a corresponding GET
> if (request.method.equals("HEAD")) {
> request.method = "GET";
> route(request);
> request.method = "HEAD";
> // *******************
> // There should be a return statement here
> // ******************
> }
> throw new NotFound(request.method, request.path);
>
> --
> Play should respond to HEAD requests if a GET route exists
> https://bugs.launchpad.net/bugs/532648
> You received this bug notification because you are subscribed to play
> framework.
>
> Status in play framework: Fix Committed
> Status in play framework 1.0 series: Fix Committed
> Status in play framework 1.1 series: Fix Committed
>
> Bug description:
> http://groups.google.com/group/play-framework/browse_thread/thread/2af0a57a896174fe?hl=en
>

Revision history for this message
Nicolas Leroux (nicolas-lunatech) wrote :

Yes, I have already modified the patch and included test cases. Have a look at the latest build.

Nicolas

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.