Closed
Bug 774392
Opened 12 years ago
Closed 12 years ago
Support for Method Not Allowed in requests
Categories
(Cloud Services :: Server: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: telliott, Assigned: rfkelly)
References
Details
(Whiteboard: [qa+])
Attachments
(1 file)
2.98 KB,
patch
|
benbangert
:
review+
|
Details | Diff | Splinter Review |
OST /valid-url returns a 404, and not a 405. This is technically incorrect, though I can see why the route-matcher would do this wrongly. It also appears to be happening on rare occasion, and causing problems for the client.
Updated•12 years ago
|
Whiteboard: [qa?]
Assignee | ||
Comment 1•12 years ago
|
||
Patch attached. If no matching route is found using the full request environ, try again using just the request path. If a match is found then 405; if not then 404 as before.
Assignee: nobody → rfkelly
Attachment #648611 -
Flags: review?(bbangert)
Comment 2•12 years ago
|
||
Comment on attachment 648611 [details] [diff] [review] patch to support 405-Method-Not-Allowed in server-core Review of attachment 648611 [details] [diff] [review]: ----------------------------------------------------------------- ::: services/baseapp.py @@ +294,5 @@ > > if match is None: > + # Check whether there is a match on just the path. > + # If not then it's a 404; if so then it's a 405. > + match = self.mapper.routematch(url=request.environ["PATH_INFO"]) Why not request.path_info?
Attachment #648611 -
Flags: review?(bbangert) → review+
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Ben Bangert [:benbangert] from comment #2) > ::: services/baseapp.py > @@ +294,5 @@ > > > > if match is None: > > + # Check whether there is a match on just the path. > > + # If not then it's a 404; if so then it's a 405. > > + match = self.mapper.routematch(url=request.environ["PATH_INFO"]) > > Why not request.path_info? I...I don't know. Changed to use request.path_info and committed in http://hg.mozilla.org/services/server-core/rev/437d1f3b2024
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•12 years ago
|
||
Marking for QA. The patch includes a functional test but it's not part of a suite that can be run against a live server. Instead, we can verify it by hand by trying to POST to /info/collections. Example using curl: curl -d "" https://scl2-sync307.services.mozilla.com/1.1/<username>/info/collections Currently this returns a 404. After deployment of this patch it should return a 405.
Whiteboard: [qa?] → [qa+]
Comment 5•12 years ago
|
||
OK. So we can certainly try this on Stage tomorrow and in Prod once it goes out.
Comment 6•12 years ago
|
||
Verified on Stage: <html> <head> <title>405 Method Not Allowed</title> </head> <body> <h1>405 Method Not Allowed</h1> The method POST is not allowed for this resource. <br /><br /> </body> </html> Will do a final verification against Production.
You need to log in
before you can comment on or make changes to this bug.
Description
•