Commit b634455a authored by Xiaowu Zhang's avatar Xiaowu Zhang

add param check for getAttachment

parent 21cd62ce
......@@ -96,7 +96,7 @@ function enableRestParamChecker(jio, shared) {
}
});
["getAttachment", "removeAttachment"].forEach(function (method) {
["removeAttachment"].forEach(function (method) {
shared.on(method, function (param) {
if (!checkId(param)) {
checkAttachmentId(param);
......@@ -104,6 +104,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) {
......
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