From 0cf737b4ce551f59f7d867fc3d7e84512f275ed5 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 21 Apr 2021 21:51:27 +0200 Subject: [PATCH] 404 rather than redirect home if 404 or 403 --- copyparty/httpcli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index c205e5a6..d7cc27bb 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -261,12 +261,14 @@ class HttpCli(object): self.absolute_urls = True - # go home if verboten self.readable, self.writable = self.conn.auth.vfs.can_access( self.vpath, self.uname ) if not self.readable and not self.writable: - self.log("inaccessible: [{}]".format(self.vpath)) + if self.vpath: + self.log("inaccessible: [{}]".format(self.vpath)) + raise Pebkac(404) + self.uparam = {"h": False} if "h" in self.uparam: