mirror of
https://github.com/9001/copyparty.git
synced 2025-11-24 07:23:22 -07:00
more hints for invalid config
This commit is contained in:
parent
7d62335c13
commit
c424a55d6f
|
|
@ -785,7 +785,7 @@ class HttpCli(object):
|
||||||
guess = "modifying" if (origin and host) else "stripping"
|
guess = "modifying" if (origin and host) else "stripping"
|
||||||
t = "cors-reject %s because request-header Origin=%r does not match request-protocol %r and host %r based on request-header Host=%r (note: if this request is not malicious, check if your reverse-proxy is accidentally %s request headers, in particular 'Origin', for example by running copyparty with --ihead='*' to show all request headers)"
|
t = "cors-reject %s because request-header Origin=%r does not match request-protocol %r and host %r based on request-header Host=%r (note: if this request is not malicious, check if your reverse-proxy is accidentally %s request headers, in particular 'Origin', for example by running copyparty with --ihead='*' to show all request headers)"
|
||||||
self.log(t % (self.mode, origin, proto, self.host, host, guess), 3)
|
self.log(t % (self.mode, origin, proto, self.host, host, guess), 3)
|
||||||
raise Pebkac(403, "rejected by cors-check")
|
raise Pebkac(403, "rejected by cors-check (see serverlog)")
|
||||||
|
|
||||||
# getattr(self.mode) is not yet faster than this
|
# getattr(self.mode) is not yet faster than this
|
||||||
if self.mode == "POST":
|
if self.mode == "POST":
|
||||||
|
|
@ -931,7 +931,7 @@ class HttpCli(object):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.log("banned for {:.0f} sec".format(rt), 6)
|
self.log("banned for {:.0f} sec".format(rt), 6)
|
||||||
self.terse_reply(b"thank you for playing", 403)
|
self.terse_reply(b"thank you for playing (see serverlog and readme)", 403)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def permit_caching(self) -> None:
|
def permit_caching(self) -> None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue