-
Notifications
You must be signed in to change notification settings - Fork 30
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
OOD reverse proxy is modifying HTTP Location header in-flight #695
Comments
➤ Eric Franz commented: When you set response.headers['Location'] don't you also need to set the status code to 302 (or 301)? |
➤ Mario Squeo commented: ericfranz I just talked with johrstrom and he sent me this: https://github.com/OSC/ondemand/blob/master/ood-portal-generator/templates/ood-portal.conf.erb#L180 That would explain why we can't overwrite Location headers. If we set the response code to 302, the same behavior happens: @app.route('/', methods=['GET']) |
➤ Eric Franz commented: The related line of code as shared by johrstrom & msquee https://github.com/OSC/ondemand/blob/cc88e23b2221296871764deabb47e069d6b8454a/ood-portal-generator/templates/ood-portal.conf.erb#L180 |
➤ Eric Franz commented: The current design of the rnode proxy assumes that all 3xx redirects specified in a response from the server itself will be to other relative paths on that server, not to a different server. Thus the current design prevents you from doing two things:
These are edge cases, but I'm unaware of any at this point that we don't have a work around for. A modification to the Apache config to avoid Header edit Location when we know it is a redirect and the location header specified is a different server would be the solution. |
Summary description:
The current design of the rnode proxy assumes that all 3xx redirects specified in a response from the server itself will be to other relative paths on that server, not to a different server. Thus the current design prevents you from doing two things:
These are edge cases, but I'm unaware of any at this point that we don't have a work around for.
A modification to the Apache config to avoid
Header edit Location
when we know it is a redirect and the location header specified is a different server would be the solution.Original description:
Route
/rnode/<host>/<port>/
is performing undesirable behavior. This route does not allow the origin server to setLocation
HTTP headers.To reproduce this, run this Flask application:
Accessing the above test application with the
/rnode
reverse proxy:https://ondemand-test.osc.edu/webtest01.hpc.osc.edu/5000/
The response HTTP headers are:
If we overwrite the
Server
header:We will see it in the response:
Location
isn't being overwritten. If we do a redirect like this:The HTTP response headers look like this:
Something is modifying the
Location
header in-flight and not respecting what the origin server sends asLocation
This issue is relevant for OSC/bc_osc_codeserver#2 (comment)
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: