Skip to content

Commit 9ca5bf4

Browse files
committed
token redirect path fix
1 parent 930d093 commit 9ca5bf4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pywebfs/pywebfs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ def download(self, path, inline=False):
997997
else:
998998
self.send_error(HTTPStatus.NOT_FOUND, "File not found")
999999

1000-
def do_checkauth(self, url_token):
1000+
def do_checkauth(self, path, url_token):
10011001
"""check authentication"""
10021002
token = os.environ.get("PYWEBFS_TOKEN")
10031003
if token and self.get_cookie("token") != token:
@@ -1007,7 +1007,7 @@ def do_checkauth(self, url_token):
10071007
else:
10081008
self.send_response(302)
10091009
self.set_cookie('token', token)
1010-
self.send_header('Location', self.path)
1010+
self.send_header('Location', path)
10111011
self.end_headers()
10121012
return False
10131013

@@ -1063,7 +1063,7 @@ def do_GET(self):
10631063
searchtxt = q.get("searchtxt", [""])[0]
10641064
download = q.get("download", [""])[0]
10651065
noperm = q.get("noperm", [""])[0]
1066-
if not self.do_checkauth(token):
1066+
if not self.do_checkauth(p.path, token):
10671067
return
10681068

10691069
global NO_PERM

0 commit comments

Comments
 (0)