Skip to content

Add support of 303 to hostRewrite option #845

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

Open
abanctelchevrel opened this issue Jun 29, 2015 · 1 comment · May be fixed by #1125
Open

Add support of 303 to hostRewrite option #845

abanctelchevrel opened this issue Jun 29, 2015 · 1 comment · May be fixed by #1125

Comments

@abanctelchevrel
Copy link

My backend implements a POST to http://api.domain.com/resources with the following response :

  • Status Code : 303 See Other
  • Location header : http://api.domain.com/resources/resourceId

I use node-http-proxy (through grunt-proxy) to bypass SOP on my single page app (hosted on localhost:9000), but when I POST on /resources I keep having rejected request because of SOP, even using the hostRewrite option as follows :

httpProxy.createProxyServer({
                ...
                hostRewrite: 'localhost:9000'
              })

Digging into node-http-proxy code I found this test on response code in setRedirectHostRewrite precondition :

var redirectRegex = /^30(1|2|3|7|8)$/;

Why not add 303 to this condition ?

abanctelchevrel added a commit to abanctelchevrel/node-http-proxy that referenced this issue Jun 29, 2015
@stanislav-grin
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants