Closed kgeis closed 8 years ago
For comparison, Koa sets req.host and req.hostname when app.proxy is true.
How about we change this line to this?
let returnToValue = encodeURIComponent(req.originalUrl);
It makes the assumption that the mock auth service is on the same host as COI... but it will be, right?
I think that will work for me. @gouldner, can you test this?
Tested in dev and on test server and works. Thanks! Brandon !!! @iambrandonn
This was included in 1512.
The change made to use req.hostname (to work in conjunction with Express' "trust proxy" setting) instead of req.get('host') in mockAuthClient.js made it so that in the non-proxy case, redirects only go to the standard port (HTTP 80, HTTPS 443). This is because req.get('host') and req.get('X-Forwarded-Host') is the entire Host header (e.g. "localhost:8090") where req.hostname is just the name of the server.
I can't find any way that Express makes it easy to handle both cases without duplicating effort in "trust proxy".