commit 39a8e8fb0c34e87d012471fa005d3dea58e0201d
parent 316a6f91b21a2cdf491621137c7d2076d640e611
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 21 Jul 2017 04:05:12 -0400
Send Content-Type: text/xml header for WebDAV PROPFIND
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js
@@ -628,6 +628,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
}
var headers = { Depth: 0 };
+ var contentTypeXML = { "Content-Type": "text/xml; charset=utf-8" };
// Get the Authorization header used in case we need to do a request
// on the parent below
@@ -640,7 +641,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
// Test whether Zotero directory exists
req = yield Zotero.HTTP.request("PROPFIND", uri, {
body: xmlstr,
- headers,
+ headers: Object.assign({}, headers, contentTypeXML),
successCodes: [207, 404],
requestObserver,
debug: true
@@ -721,7 +722,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
// Zotero directory wasn't found, so see if at least
// the parent directory exists
req = yield Zotero.HTTP.request("PROPFIND", parentURI, {
- headers,
+ headers: Object.assign({}, headers, contentTypeXML),
body: xmlstr,
requestObserver,
successCodes: [207, 404]
@@ -982,9 +983,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
uri,
{
body: xmlstr,
- headers: {
- Depth: 1
- },
+ headers: Object.assign({ Depth: 1 }, contentTypeXML),
successCodes: [207],
debug: true
}