Skip to content

Commit

Permalink
avoid 'Directory listing forbidden' error
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 7, 2024
1 parent ea68949 commit 309a7c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xpra/net/http/http_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,15 @@ def send_head(self):
if os.path.exists(index):
path = index
break
else:
if os.path.isdir(path):
if not self.directory_listing:
self.send_error(403, "Directory listing forbidden")
return None
code, headers, body = list_directory(path)
self.send_response(code)
self.extra_headers.update(headers)
self.end_headers()
return body
code, headers, body = list_directory(path)
self.send_response(code)
self.extra_headers.update(headers)
self.end_headers()
return body
try:
code, extra_headers, content = load_path(self.headers, path)
lm = extra_headers.get("Last-Modified")
Expand Down

0 comments on commit 309a7c6

Please sign in to comment.