Closed dprgarner closed 1 year ago
That's a great improvement. What about adding the comma split also over the x-forwarded-host
? Even if it is not the Forwarded http header it's the standard de facto.
That's a great improvement. What about adding the comma split also over the
x-forwarded-host
? Even if it is not the Forwarded http header it's the standard de facto.
Sure. I've pushed a commit which does this, too.
Merged! Thanks @dprgarner and @Valerioageno! I’ll publish a release on npm with this shortly. It’s a holiday weekend here so may take a day or two. Strongly appreciate you’re work 🙏
Any word on publishing the latest @jakeburden ?
There's no formal standard on the "x-forwarded-proto" header, but it isn't always a single value like
http
orhttps
: it's sometimes set to a multi-valued list, likex-forwarded-proto: https,http
. If there are multiple protocols, then the absolutely-constructed URL needs to pick one. Otherwise, it constructs a buggy URL like"https,http://example.com"
This PR fixes the
protocol
to use the first listed protocol from the header. I've also fixed some failing tests and rebuildindex.js
, which was out-of-sync. (That file should probably not be source-controlled...)