Add support of 303 to hostRewrite option
Created by: abanctelchevrel
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 ?