1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-28 19:40:54 +00:00

assert sanitized and stripped paths

This commit is contained in:
Unrud 2018-08-28 16:19:50 +02:00
parent c08754cf92
commit 5429f5c1a9
19 changed files with 108 additions and 72 deletions

View file

@ -28,7 +28,7 @@ import posixpath
from http import client
from urllib.parse import quote
from radicale import httputils, storage, xmlutils
from radicale import httputils, pathutils, storage, xmlutils
from radicale.log import logger
@ -66,7 +66,7 @@ class ApplicationGetMixin:
def do_GET(self, environ, base_prefix, path, user):
"""Manage GET request."""
# Redirect to .web if the root URL is requested
if not path.strip("/"):
if not pathutils.strip_path(path):
web_path = ".web"
if not environ.get("PATH_INFO"):
web_path = posixpath.join(posixpath.basename(base_prefix),