diff --git a/jio.js b/jio.js index 7ef8baa3557c845970a456f3c5a4a474434d704c..99b63108008a73ed9726d1c6c52f3c6e36f86f4b 100644 --- a/jio.js +++ b/jio.js @@ -3569,7 +3569,7 @@ function enableRestParamChecker(jio, shared) { } }); - ["getAttachment", "removeAttachment"].forEach(function (method) { + ["removeAttachment"].forEach(function (method) { shared.on(method, function (param) { if (!checkId(param)) { checkAttachmentId(param); @@ -3577,6 +3577,26 @@ function enableRestParamChecker(jio, shared) { }); }); + + ["getAttachment"].forEach(function (method) { + shared.on(method, function (param) { + if (param.storage_spec.type !== "indexeddb" && + param.storage_spec.type !== "dav" && + (param.kwargs._start !== undefined + || param.kwargs._end !== undefined)) { + restCommandRejecter(param, [ + 'bad_request', + 'unsupport', + '_start, _end not support' + ]); + return false; + } + if (!checkId(param)) { + checkAttachmentId(param); + } + }); + }); + ["check", "repair"].forEach(function (method) { shared.on(method, function (param) { if (param.kwargs._id !== undefined) {