Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to use 302 redirect with RedirectAsync #20

Open
jkapi opened this issue Feb 23, 2018 · 1 comment
Open

Make it possible to use 302 redirect with RedirectAsync #20

jkapi opened this issue Feb 23, 2018 · 1 comment
Labels

Comments

@jkapi
Copy link
Contributor

jkapi commented Feb 23, 2018

Currently HttpListenerResponse.RedirectAsync uses status code 301, Moved Permanently. This can cause unwanted behavoir because Google Chrome caches this.
Possible scenario:
You want to go to /users, but you have to be logged in, so you use RedirectAsync to go to /login. After you logged in you are redirected back to possibly /index or another page. What can happen now is that if you want to go to /login, you're automatically transferred to /index and the same with /users (getting transferred to /login).
If you use 302, Redirect this move will not be cached, doing the same as PHP.

@StefH
Copy link
Owner

StefH commented Feb 25, 2018

Currently it's hardcoded in the source code to use 301.

Would it be an option to make it possible to indicate yourself how redirects are handled? (By the construction from the listener maybe?)

@StefH StefH added the question label Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants