Closed Bug 694129 Opened 13 years ago Closed 12 years ago

Spec and server bug and inconsistency: method not allowed

Categories

(Cloud Services Graveyard :: Server: Sync, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rnewman, Assigned: rfkelly)

Details

(Whiteboard: [qa+])

If you attempt a non-DELETE request to /storage, the server returns a 404. I imagine this is because the URL dispatcher in use clownshoesily is matching (method, path), rather than matching path and then deciding if the method is appropriate.

The correct response is 405 Method Not Allowed, with an Allow: DELETE header.

The spec is entirely and completely silent on the topic.

Both of these should be fixed, and similar inconsistencies addressed within the document and the server code.

I am interested to know what the PHP server did in this case. If it differs, this should be flagged as a regression.
PHP also returned a 404 in this situation (though it would have been much easier to change that code to a 405)

Will poke around in Routes to see how to do this. 

The spec being silent is actually correct here in that it defines acceptable URLs for each method, rather than acceptable methods for each URL. Swapping that around would be interesting.
(In reply to Toby Elliott [:telliott] from comment #1)

> The spec being silent is actually correct here in that it defines acceptable
> URLs for each method, rather than acceptable methods for each URL. Swapping
> that around would be interesting.

If by "interesting" you mean "more like HTTP" ;)
"more like HTTP" and less "how the rest of the world thinks about it" :) Not sure there's a dispatcher out there that doesn't match by (method, path).

Which does leave us a nice opening. It's obviously trivial to just route DELETE to a controller that 405s with the appropriate response, but it would be pretty sweet if we could find a clean way to do that on top of Pyramid, rather than as a one-off. (Especially since the one-off would need to be done repeatedly, given that there are like 9 verbs). Adding in Ben, who probably has interest in this, as well as Tarek.
Assignee: nobody → rkelly
Whiteboard: [qa+]
Cornice takes care of this automatically for sync2.0, and no more changes are going in for sync1.1.  Marking as fixed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.