diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2016-01-25 07:36:02 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2016-01-25 09:49:24 +0100 |
commit | 2f82457bbc4e0aba4be0dc513524b06ba4e800d4 (patch) | |
tree | 4b230df42abf811eb474705cc965d549db5f03df /contrib/caldav | |
parent | 7e7d21722adb1d456b269f387b909e86ff6828e2 (diff) | |
download | calcurse-2f82457bbc4e0aba4be0dc513524b06ba4e800d4.zip |
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 <lfleischer@calcurse.org>
Diffstat (limited to 'contrib/caldav')
-rwxr-xr-x | contrib/caldav/calcurse-caldav.py | 5 |
1 files changed, 4 insertions, 1 deletions
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: |