Skip to content

Commit

Permalink
Fix infinite redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
beavailable committed Oct 3, 2022
1 parent f278c2e commit 87170d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion share.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ def split_path(self, path):
parts.pop()
elif p and p != '.':
parts.append(p)
return ('/' + '/'.join(parts), query)
collapsed_path = '/' + '/'.join(parts)
if path != '/' and path.endswith('/'):
collapsed_path += '/'
return (collapsed_path, query)

def respond_for_file(self, file):
include_content_disposition = self._is_from_commandline()
Expand Down

0 comments on commit 87170d4

Please sign in to comment.