aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-12-12 20:29:58 +0100
committerAnton Khirnov <anton@khirnov.net>2023-12-12 20:29:58 +0100
commit539536069a6e1311921e4ead9b177d33df2bc102 (patch)
tree61245867461c9f331d92dd82631bae005c050dca
parentd4e65382822a44c40946e08af4af82f322b6e464 (diff)
Fix DELETE handling for private mode.
Public mode is still broken. Reported by another.
-rwxr-xr-xfshare.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/fshare.py b/fshare.py
index 61d9dcd..ec94b2b 100755
--- a/fshare.py
+++ b/fshare.py
@@ -482,12 +482,12 @@ class FShareRequestHandler(hs.BaseHTTPRequestHandler):
fname = self._process_path(self.path)
- path = '/'.join((self.server.data_dir, fname))
+ local_path = '/'.join((self.server.data_dir, fname))
try:
- os.remove(targetpath)
+ os.remove(local_path)
except FileNotFoundError:
- self._logger.error('DELETE request for non-existing file: %s' %
- local_path.decode('utf-8', errors = 'backslashreplace'))
+ self._logger.error('DELETE request for non-existing file: %s',
+ local_path)
self.send_error(HTTPStatus.NOT_FOUND)
return