mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
cmd/stdiscosrv: Don't abuse wrong header (#6749)
This commit is contained in:
parent
df83b84aa1
commit
f310bbaaac
@ -139,7 +139,7 @@ func (s *apiSrv) handler(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
if s.useHTTP {
|
||||
remoteAddr.IP = net.ParseIP(req.Header.Get("X-Forwarded-For"))
|
||||
if parsedPort, err := strconv.ParseInt(req.Header.Get("X-Forwarded-Port"), 10, 0); err == nil {
|
||||
if parsedPort, err := strconv.ParseInt(req.Header.Get("X-Client-Port"), 10, 0); err == nil {
|
||||
remoteAddr.Port = int(parsedPort)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user