mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
fix ipv4 location header on dualstack
This commit is contained in:
parent
1550350e05
commit
c8938fc033
|
@ -264,9 +264,10 @@ class HttpCli(object):
|
||||||
self.is_https = (
|
self.is_https = (
|
||||||
self.headers.get("x-forwarded-proto", "").lower() == "https" or self.tls
|
self.headers.get("x-forwarded-proto", "").lower() == "https" or self.tls
|
||||||
)
|
)
|
||||||
self.host = self.headers.get("host") or "{}:{}".format(
|
self.host = self.headers.get("host")
|
||||||
*list(self.s.getsockname()[:2])
|
if not self.host:
|
||||||
)
|
zs = "{}:{}".format(*list(self.s.getsockname()[:2]))
|
||||||
|
self.host = zs[7:] if zs.startswith("::ffff:") else zs
|
||||||
|
|
||||||
n = self.args.rproxy
|
n = self.args.rproxy
|
||||||
if n:
|
if n:
|
||||||
|
|
Loading…
Reference in a new issue