From 2f82457bbc4e0aba4be0dc513524b06ba4e800d4 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 25 Jan 2016 07:36:02 +0100 Subject: calcurse-caldav: Fix MIME type in requests Specify application/xml in the Content-Type of requests except for PUT, where we actually submit calendar data. Signed-off-by: Lukas Fleischer --- contrib/caldav/calcurse-caldav.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/caldav/calcurse-caldav.py') diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py index ff6bdc1..f7eb306 100755 --- a/contrib/caldav/calcurse-caldav.py +++ b/contrib/caldav/calcurse-caldav.py @@ -84,7 +84,10 @@ def get_auth_headers(): def remote_query(cmd, path, additional_headers, body): headers = get_auth_headers() - headers['Content-Type'] = 'Content-Type: text/calendar; charset=utf-8' + if cmd == 'PUT': + headers['Content-Type'] = 'Content-Type: text/calendar; charset=utf-8' + else: + headers['Content-Type'] = 'Content-Type: application/xml; charset=utf-8' headers.update(additional_headers) if debug: -- cgit v1.2.3-54-g00ecf