From 8db580abce502572cdafdef2de6f0aa66e75ce2b Mon Sep 17 00:00:00 2001 From: Unrud Date: Thu, 25 Aug 2016 05:30:46 +0200 Subject: [PATCH] Try to decode URLs with utf-8 (Fixes #486) --- radicale/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/radicale/__init__.py b/radicale/__init__.py index 0bc8d1d..e11ffc8 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -38,6 +38,7 @@ import socketserver import ssl import subprocess import threading +import urllib import wsgiref.simple_server import zlib from contextlib import contextmanager @@ -133,6 +134,12 @@ class RequestHandler(wsgiref.simple_server.WSGIRequestHandler): def log_message(self, *args, **kwargs): """Disable inner logging management.""" + def get_environ(self): + env = super().get_environ() + # Parent class only tries latin1 encoding + env["PATH_INFO"] = urllib.parse.unquote(self.path.split("?", 1)[0]) + return env + class Application: """WSGI application managing collections."""