Commit 235101a8 authored by Tristan Cavelier's avatar Tristan Cavelier

add unsupported options to dav storage

parent 37d48b2e
...@@ -800,6 +800,15 @@ ...@@ -800,6 +800,15 @@
then(o.success, o.reject, o.notifyProgress); then(o.success, o.reject, o.notifyProgress);
}; };
function makeUnsupportedOptionsError(rejected_options) {
return {
"status": 501,
"error": "UnsupportedOptionError",
"reason": "unsupported option",
"arguments": rejected_options
};
}
/** /**
* Retrieve a list of present document * Retrieve a list of present document
* *
...@@ -871,9 +880,19 @@ ...@@ -871,9 +880,19 @@
e.target.statusText, e.target.statusText,
o.error_message o.error_message
); );
} },
rejected_options: []
}; };
Object.keys(options).forEach(function (opt) {
if (opt !== "include_docs") {
o.rejected_options.push(opt);
}
});
if (o.rejected_options.length) {
return command.error(makeUnsupportedOptionsError(o.rejected_options));
}
this._allDocs(param, options). this._allDocs(param, options).
then(o.getAllMetadataIfNecessary). then(o.getAllMetadataIfNecessary).
then(o.success, o.reject, o.notifyProgress); then(o.success, o.reject, o.notifyProgress);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment