From 539536069a6e1311921e4ead9b177d33df2bc102 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 12 Dec 2023 20:29:58 +0100 Subject: Fix DELETE handling for private mode. Public mode is still broken. Reported by another. --- fshare.py | 8 ++++---- 1 file 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 -- cgit v1.2.3