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.
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.