mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
Merge *base_prefix config keys into base_prefix (fixes #996)
This commit is contained in:
parent
eaa969a05c
commit
bf8e874e4d
6 changed files with 39 additions and 40 deletions
|
@ -246,9 +246,17 @@ class Application(object):
|
|||
headers = pprint.pformat(self.headers_log(environ))
|
||||
log.LOGGER.debug("Request headers:\n%s" % headers)
|
||||
|
||||
# Sanitize request URI
|
||||
environ["PATH_INFO"] = self.sanitize_uri(environ["PATH_INFO"])
|
||||
log.LOGGER.debug("Sanitized path: %s", environ["PATH_INFO"])
|
||||
base_prefix = config.get("server", "base_prefix")
|
||||
if environ["PATH_INFO"].startswith(base_prefix):
|
||||
# Sanitize request URI
|
||||
environ["PATH_INFO"] = self.sanitize_uri(
|
||||
"/%s" % environ["PATH_INFO"][len(base_prefix):])
|
||||
log.LOGGER.debug("Sanitized path: %s", environ["PATH_INFO"])
|
||||
else:
|
||||
# Request path not starting with base_prefix, not allowed
|
||||
log.LOGGER.debug(
|
||||
"Path not starting with prefix: %s", environ["PATH_INFO"])
|
||||
environ["PATH_INFO"] = None
|
||||
|
||||
# Get content
|
||||
content_length = int(environ.get("CONTENT_LENGTH") or 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue