Fix wss in x-forwarded-proto

This commit is contained in:
Julien Salleyron 2020-04-30 18:00:04 +02:00 committed by GitHub
parent efcaf64a43
commit e22c62baba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -141,7 +141,7 @@ func (x *XForwarded) rewrite(outreq *http.Request) {
}
if isWebsocketRequest(outreq) {
if outreq.Header.Get(xForwardedProto) == "https" {
if outreq.Header.Get(xForwardedProto) == "https" || outreq.Header.Get(xForwardedProto) == "wss" {
outreq.Header.Set(xForwardedProto, "wss")
} else {
outreq.Header.Set(xForwardedProto, "ws")