csmith / centauri

TLS-terminating reverse proxy in Go
MIT License
1 stars 1 forks source link

`X-Forwarded-Proto` is empty on some proxied requests #86

Closed ShaneMcC closed 3 months ago

ShaneMcC commented 3 months ago

image

At https://github.com/csmith/centauri/blob/master/proxy/decorator.go#L52 centauri does:

req.Header.Set("X-Forwarded-Proto", req.URL.Scheme)

But this is not guaranteed to actually contain a valid scheme (See: https://github.com/golang/go/issues/28940)

csmith commented 3 months ago

Thanks for the report ;)

It's weird, I'm sure it used to be populated correctly but I can see no evidence it ever was.

Changed how it detects the protocol, and it will now always be http or https as of v0.5.1.