Extend @removeslash also to POST, PUT and DELETE #678

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@dhilipsiva

No description provided.

@bdarnell
tornadoweb member

What's the use case for this? In general, redirecting non-GET requests is tricky. For historical reasons, when browsers (and therefore most other clients) get a 301 or 302, they change the method to GET when following a redirect. You could use 307 instead, but older browsers don't really support it (and 307 is a temporary redirect; the equivalent for 301 is not even official yet but will eventually be 308: http://trac.tools.ietf.org/html/draft-reschke-http-status-308-07).

Furthermore, the reason for removeslash (and addslash, which you should also modify if you're touching removeslash) in the first place is to accomodate users typing urls into the address bar incorrectly. This always results in a GET. Other methods aren't subject to the same likelihood of human error, so returning an error so the code responsible for the request can be noticed and fixed is the more appropriate response.

@bdarnell bdarnell closed this Feb 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment