From a0fc07a89445922bb58ca1c4acc581857f9c552b Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 29 Apr 2015 19:07:17 +0200 Subject: [PATCH] Allow content-types with ';' in charset, fix #279 --- radicale/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 55329e5..92673de 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -159,7 +159,8 @@ class Application(object): # First append content charset given in the request content_type = environ.get("CONTENT_TYPE") if content_type and "charset=" in content_type: - charsets.append(content_type.split("charset=")[1].strip()) + charsets.append( + content_type.split("charset=")[1].split(";")[0].strip()) # Then append default Radicale charset charsets.append(self.encoding) # Then append various fallbacks