소스 검색

Allow content-types with ';' in charset, fix #279

Guillaume Ayoub 10 년 전
부모
커밋
a0fc07a894
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      radicale/__init__.py

+ 2 - 1
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