Skip to content

Commit

Permalink
Add check for base_prefix indicating Radicale running at site root (/)
Browse files Browse the repository at this point in the history
Alternative to PR #1310
  • Loading branch information
Daniel Lange authored and pbiering committed Oct 28, 2024
1 parent ef26c9b commit 2f7a331
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion radicale/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def response(status: int, headers: types.WSGIResponseHeaders,
if base_prefix_src == "HTTP_X_SCRIPT_NAME":
return response(*httputils.BAD_REQUEST)
return response(*httputils.INTERNAL_SERVER_ERROR)
if base_prefix.endswith("/"):
if base_prefix and base_prefix != "/" and base_prefix.endswith("/"):
logger.warning("Base prefix (from %s) must not end with '/': %r",
base_prefix_src, base_prefix)
base_prefix = base_prefix.rstrip("/")
Expand Down

0 comments on commit 2f7a331

Please sign in to comment.