Skip to content

Make it possible to use 302 redirect with RedirectAsync #20

Open

Description

@zoeykapi

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.

Activity

  1. StefH commented on Feb 25, 2018

    @StefH
    Owner

    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?)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions