mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -06:00
fix ipv6 cors-chk
This commit is contained in:
parent
6069bc9b19
commit
e9684d402e
|
@ -1114,15 +1114,18 @@ class HttpCli(object):
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
host = self.host.lower()
|
||||||
|
if host.startswith("["):
|
||||||
|
if "]:" in host:
|
||||||
|
host = host.split("]:")[0] + "]"
|
||||||
|
else:
|
||||||
|
host = host.split(":")[0]
|
||||||
|
|
||||||
oh = self.out_headers
|
oh = self.out_headers
|
||||||
origin = origin.lower()
|
origin = origin.lower()
|
||||||
good_origins = self.args.acao + [
|
proto = "https" if self.is_https else "http"
|
||||||
"%s://%s"
|
good_origins = self.args.acao + ["%s://%s" % (proto, host)]
|
||||||
% (
|
|
||||||
"https" if self.is_https else "http",
|
|
||||||
self.host.lower().split(":")[0],
|
|
||||||
)
|
|
||||||
]
|
|
||||||
if "pw" in ih or re.sub(r"(:[0-9]{1,5})?/?$", "", origin) in good_origins:
|
if "pw" in ih or re.sub(r"(:[0-9]{1,5})?/?$", "", origin) in good_origins:
|
||||||
good_origin = True
|
good_origin = True
|
||||||
bad_hdrs = ("",)
|
bad_hdrs = ("",)
|
||||||
|
|
Loading…
Reference in a new issue