Fix crash if Content-Type is not given in request.

This commit is contained in:
Guillaume Ayoub 2010-04-09 21:56:20 +02:00
parent efed0b415d
commit f075224d3d

View File

@ -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