diff options
author | Eion Robb <eion@robbmob.com> | 2017-07-24 00:04:27 +0300 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2017-07-24 00:04:27 +0300 |
commit | 99045e1457858e8f29808fd6fbc899ce5c2a6eac (patch) | |
tree | dc5b21fd3d9943c919555f7bd50e94869eac92b3 | |
parent | 2ea69c79db8d74797a8178d70b41302cf46802d0 (diff) |
Fix for deny auth requests being ignored
-rw-r--r-- | skypeweb/skypeweb_connection.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/skypeweb/skypeweb_connection.c b/skypeweb/skypeweb_connection.c index 9d8247a..097e806 100644 --- a/skypeweb/skypeweb_connection.c +++ b/skypeweb/skypeweb_connection.c @@ -94,13 +94,18 @@ SkypeWebConnection *skypeweb_post_or_get(SkypeWebAccount *sa, SkypeWebMethod met purple_http_request_set_max_redirects(request, 0); purple_http_request_set_timeout(request, 120); - if (method & (SKYPEWEB_METHOD_POST | SKYPEWEB_METHOD_PUT)) { + if (method & (SKYPEWEB_METHOD_POST | SKYPEWEB_METHOD_PUT)) { if (postdata && (postdata[0] == '[' || postdata[0] == '{')) { purple_http_request_header_set(request, "Content-Type", "application/json"); // hax } else { purple_http_request_header_set(request, "Content-Type", "application/x-www-form-urlencoded"); } purple_http_request_set_contents(request, postdata, -1); + + //Zero-length PUT's dont get the content-length header set + if ((method & SKYPEWEB_METHOD_PUT) && (!postdata || !*postdata)) { + purple_http_request_header_set(request, "Content-Length", "0"); + } } if (g_str_equal(host, SKYPEWEB_CONTACTS_HOST) || g_str_equal(host, SKYPEWEB_VIDEOMAIL_HOST) || g_str_equal(host, SKYPEWEB_NEW_CONTACTS_HOST)) { |