From f075224d3d195cf4c36c90190f2b0dd9fc066a23 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 9 Apr 2010 21:56:20 +0200 Subject: [PATCH] Fix crash if Content-Type is not given in request. --- radicale/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 886b3d8..b02c98c 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -120,7 +120,7 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler): charsets = [] # First append content charset given in the request - content_type = self.headers["Content-Type"] + content_type = self.headers.get("Content-Type", None) if content_type and "charset=" in content_type: charsets.append(content_type.split("charset=")[1].strip()) # Then append default Radicale charset