Closed offtherailz closed 8 years ago
The code for this is already present but supports only http status codes 300 and 304, It should support 301 and 302 too (maybe more) here: https://github.com/geosolutions-it/http-proxy/blob/master/src/main/java/it/geosolutions/httpproxy/HTTPProxy.java#L693
We should create a test for this,maybe externalizing this check in a separate utility class.
an http response to redirect (e.g. 301) simply turn back the response. A client will be redirected to the URL in the Location header, and not the proxy-ed one.
E.g.
Response Headers:
Then the browser will generate an error if the cross-origin request is not allowed (headers).
I propose add the (optional) replacement of the Location header with the current URL of the proxy: