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