-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I started running the SAI service behind a reverse proxy, which terminates HTTPS. I'm not sure how to get the correct context.request.url. I get http instead of https.
In CSS they use the 'X-Forwarded-Proto' header on the request. As shown in this snippet:
https://github.com/solid/solidproject.org/wiki/Using-NGINX-as-a-reverse-proxy#configuration
Also seen in code: https://github.com/CommunitySolidServer/CommunitySolidServer/blob/4599bf413e0ca08725d22b5e01fe43e97ef7d714/src/http/input/identifier/OriginalUrlExtractor.ts#L46-L53
I wasn't able to find how the same can be achieved in handlersjs.
After a quick look at the code, I found one place where http seems to be hardcoded
handlersjs/packages/handlersjs-http/lib/servers/node/node-http-request-response.handler.ts
Line 207 in 876bbfe
| const urlObject: URL = new URL(url.replace(/^\/+/, '/'), `http://${nodeHttpStreams.requestStream.headers.host}`); |