url_helper: redirect() - HTTP/1.1 compliance for redirect after post. #338

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

Contributor
ktomk commented Aug 29, 2011

For a more seamless integration with the Post/Redirect/Get (PRG) pattern in CI, see http://en.wikipedia.org/wiki/Post/Redirect/Get .

In HTTP/1.1 on a post request it should be opted for the 303 redirect code.

To have this easily available, the redirect() function inside the url_helper could just take care of that.

Contributor
narfbg commented Jun 16, 2012

I like this one, and prepared a little more polished patch based on the current version in develop: https://gist.github.com/2942361

Tested it and works fine, but as it's described in the link from the description above - the benefit is that the script can continue its exectuion and what redirect() does is to exit immediately after sending the Location header. So is there a real benefit? Did some research but I couldn't find anything other than that.

@narfbg narfbg closed this Jun 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment