mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
curl/CLI-friendly 403/404
This commit is contained in:
parent
5b26ab0096
commit
829c8fca96
|
@ -3363,11 +3363,19 @@ class HttpCli(object):
|
||||||
rc = 404
|
rc = 404
|
||||||
if self.args.vague_403:
|
if self.args.vague_403:
|
||||||
t = '<h1 id="n">404 not found ┐( ´ -`)┌</h1><p id="o">or maybe you don\'t have access -- try logging in or <a href="{}/?h">go home</a></p>'
|
t = '<h1 id="n">404 not found ┐( ´ -`)┌</h1><p id="o">or maybe you don\'t have access -- try logging in or <a href="{}/?h">go home</a></p>'
|
||||||
|
pt = "404 not found ┐( ´ -`)┌ (or maybe you don't have access -- try logging in)"
|
||||||
elif is_403:
|
elif is_403:
|
||||||
t = '<h1 id="p">403 forbiddena ~┻━┻</h1><p id="q">you\'ll have to log in or <a href="{}/?h">go home</a></p>'
|
t = '<h1 id="p">403 forbiddena ~┻━┻</h1><p id="q">you\'ll have to log in or <a href="{}/?h">go home</a></p>'
|
||||||
|
pt = "403 forbiddena ~┻━┻ (you'll have to log in)"
|
||||||
rc = 403
|
rc = 403
|
||||||
else:
|
else:
|
||||||
t = '<h1 id="n">404 not found ┐( ´ -`)┌</h1><p><a id="r" href="{}/?h">go home</a></p>'
|
t = '<h1 id="n">404 not found ┐( ´ -`)┌</h1><p><a id="r" href="{}/?h">go home</a></p>'
|
||||||
|
pt = "404 not found ┐( ´ -`)┌"
|
||||||
|
|
||||||
|
if self.ua.startswith("curl/") or self.ua.startswith("fetch"):
|
||||||
|
pt = "# acct: %s\n%s" % (self.uname, pt)
|
||||||
|
self.reply(pt.encode("utf-8"), status=rc)
|
||||||
|
return True
|
||||||
|
|
||||||
t = t.format(self.args.SR)
|
t = t.format(self.args.SR)
|
||||||
qv = quotep(self.vpaths) + self.ourlq()
|
qv = quotep(self.vpaths) + self.ourlq()
|
||||||
|
|
Loading…
Reference in a new issue