Skip to content

Commit

Permalink
[relay] Handle IPv6 addresses in X-Real-IP header on relay service (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jnohlgard authored Jan 6, 2025
1 parent 6848e1e commit 2bd68ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion relay/server/listener/ws/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ func remoteAddr(r *http.Request) string {
if r.Header.Get("X-Real-Ip") == "" || r.Header.Get("X-Real-Port") == "" {
return r.RemoteAddr
}
return fmt.Sprintf("%s:%s", r.Header.Get("X-Real-Ip"), r.Header.Get("X-Real-Port"))
return net.JoinHostPort(r.Header.Get("X-Real-Ip"), r.Header.Get("X-Real-Port"))
}

0 comments on commit 2bd68ef

Please sign in to comment.