Skip to content

Commit

Permalink
Send Content-Type: text/xml header for WebDAV PROPFIND
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Jul 21, 2017
1 parent 316a6f9 commit 39a8e8f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions chrome/content/zotero/xpcom/storage/webdav.js
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 39a8e8f

Please sign in to comment.