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
This commit is contained in:
Dan Stillman 2022-12-17 03:59:16 -07:00
parent 1a83b472e8
commit da392518ed

View file

@ -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;