From 32b6e0a48537f5791e134cbcb216ac4dfc6617d7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 17 Dec 2022 03:59:16 -0700 Subject: [PATCH] Allow 204 response to OPTIONS request from WebDAV server https://forums.zotero.org/discussion/101824/possible-to-allow-http-204-response-for-options-request-in-webdav-server-check The specs used to (seemingly inadvertently) disallow 204 for OPTIONS, but they've been clarified to make it clear that it's allowed [1], and MDN now even shows it as an example [2]. [1] https://stackoverflow.com/a/57455110 [2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS --- chrome/content/zotero/xpcom/storage/webdav.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index a9b846e703..e2d604d8a2 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -221,6 +221,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = { "OPTIONS", this.rootURI, { + successCodes: [200, 204, 404], errorDelayIntervals: this.ERROR_DELAY_INTERVALS, errorDelayMax: this.ERROR_DELAY_MAX, } @@ -622,7 +623,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = { "OPTIONS", uri, { - successCodes: [200, 404], + successCodes: [200, 204, 404], requestObserver: function (req) { if (req.channel) { channel = req.channel;