mikehaertl / localeurls

Automatic locale/language management for URLs
10 stars 3 forks source link

Redirecting only GET requests #11

Closed tatarko closed 10 years ago

tatarko commented 10 years ago

If some form is pointing to the URL with different language than language stored in cookie/session user is redirected and POST data are lost. This MR resolves it with redirecting only if it is GET request.

mikehaertl commented 10 years ago

Hmm, I don't think, that's really correct: If a form is submitted with a correct language URL then there's no redirect. So if you have problems here, you should instead create the correct submit URL for the form.

tatarko commented 10 years ago

Yes, I can correct URL on my website, but I am not able to correct url pointing to form on my website from other websites - and I need it for one specific project.

mikehaertl commented 10 years ago

Well, I understand your problem, but you should not have handed out wrong form URLs to third party sites. Since this is a very special problem I'm sorry to say, that we won't fix this here.

tatarko commented 10 years ago

What about this as a opt-in functionality (some new property)?

mikehaertl commented 10 years ago

We could do this, but I want to keep the code as clean and focussed as possible. Otherwhise extending and maintaining the code becomes a nightmare: You have to think about all kind of edge cases and be very careful that nothing breaks.

You still can use your modified class in your project, no?

tatarko commented 10 years ago

Yes, I understand. My own will work for me just fine ;) I just thought that maybe more developers could have same problems as me, so I decided to post this MR...