mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
skip more stuff windows doesn't like
This commit is contained in:
parent
4e8b651e18
commit
9269bc84f2
|
@ -210,11 +210,14 @@ class HttpCli(object):
|
|||
self.uparam = uparam
|
||||
self.cookies = cookies
|
||||
self.vpath = unquotep(vpath) # not query, so + means +
|
||||
|
||||
ok = "\x00" not in self.vpath
|
||||
if ANYWIN:
|
||||
mod = relchk(self.vpath)
|
||||
if mod:
|
||||
self.log("invalid relpath [{}]".format(self.vpath))
|
||||
return self.tx_404() and self.keepalive
|
||||
ok = ok and not relchk(self.vpath)
|
||||
|
||||
if not ok:
|
||||
self.log("invalid relpath [{}]".format(self.vpath))
|
||||
return self.tx_404() and self.keepalive
|
||||
|
||||
pwd = None
|
||||
ba = self.headers.get("authorization")
|
||||
|
|
|
@ -942,9 +942,12 @@ def sanitize_fn(fn, ok, bad):
|
|||
|
||||
def relchk(rp):
|
||||
if ANYWIN:
|
||||
if "\n" in rp or "\r" in rp:
|
||||
return "x\nx"
|
||||
|
||||
p = re.sub(r'[\\:*?"<>|]', "", rp)
|
||||
if p != rp:
|
||||
return p
|
||||
return "[{}]".format(p)
|
||||
|
||||
|
||||
def absreal(fpath):
|
||||
|
|
Loading…
Reference in a new issue