Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Only auto-redirect safe requests #2626

Closed
kriswallsmith opened this Issue Nov 11, 2011 · 4 comments

Comments

Projects
None yet
4 participants
Contributor

kriswallsmith commented Nov 11, 2011

Given a route exists with pattern /foo/ that requires a POST method and a POST /foo request is received, the router will redirect to GET /foo/, which does not match the same route. I suggest we only redirect to add a trailing slash when the route accepts GET requests.

Owner

fabpot commented Nov 14, 2011

Do we only redirect when the current request method is safe (GET or HEAD) or when the matched route supports GET? I think the former is best.

Contributor

kriswallsmith commented Nov 14, 2011

Sounds good to me.

On Nov 14, 2011, at 4:25 AM, Fabien Potencier
reply@reply.github.com
wrote:

Do we only redirect when the current request method is safe (GET or HEAD) or when the matched route supports GET? I think the former is best.


Reply to this email directly or view it on GitHub:
#2626 (comment)

Contributor

mvrhov commented Nov 14, 2011

While not directly related to what kris wrote. fabpot would you care to explain the behavior in this https://gist.github.com/862547 gist.

Contributor

canni commented Nov 17, 2011

@mvrhov you forgot to define "/" route

"/{step}" will not match http://foo/trgovina/
"/" will match

@fabpot fabpot closed this in d12f5b2 Dec 30, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment