Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report NotImplemented for stubbed routes #441

Merged
merged 1 commit into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/controllers/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ exports.METHODS = [
"encryption",
"inventory",
"lifecycle",
"location",
"metrics",
"notification",
"object-lock",
Expand Down
36 changes: 22 additions & 14 deletions lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ router
case "policy":
case "replication":
case "tagging":
ctx.throw(501);
break;
throw new S3Error(
"NotImplemented",
"A parameter you provided implies functionality that is not implemented"
);
default:
ctx.state.methodIsNotAllowed = true;
}
Expand Down Expand Up @@ -93,8 +95,10 @@ router
case "tagging":
case "uploads":
case "versioning":
ctx.throw(501);
break;
throw new S3Error(
"NotImplemented",
"A parameter you provided implies functionality that is not implemented"
);
default:
ctx.state.methodIsNotAllowed = true;
}
Expand Down Expand Up @@ -133,8 +137,10 @@ router
case "requestPayment":
case "tagging":
case "versioning":
ctx.throw(501);
break;
throw new S3Error(
"NotImplemented",
"A parameter you provided implies functionality that is not implemented"
);
default:
ctx.state.methodIsNotAllowed = true;
}
Expand All @@ -148,8 +154,7 @@ router
case undefined:
return objectCtrl.deleteObject(ctx);
case "tagging":
ctx.throw(501);
break;
throw new S3Error("NotImplemented");
default:
ctx.state.methodIsNotAllowed = true;
}
Expand All @@ -164,8 +169,10 @@ router
case "retention":
case "tagging":
case "torrent":
ctx.throw(501);
break;
throw new S3Error(
"NotImplemented",
"A parameter you provided implies functionality that is not implemented"
);
default:
ctx.state.methodIsNotAllowed = true;
}
Expand All @@ -178,8 +185,7 @@ router
return objectCtrl.initiateMultipartUpload(ctx);
case undefined:
case "select":
ctx.throw(501);
break;
throw new S3Error("NotImplemented");
default:
ctx.state.methodIsNotAllowed = true;
}
Expand All @@ -194,8 +200,10 @@ router
return objectCtrl.uploadPart(ctx);
case "acl":
case "tagging":
ctx.throw(501);
break;
throw new S3Error(
"NotImplemented",
"A parameter you provided implies functionality that is not implemented"
);
default:
ctx.state.methodIsNotAllowed = true;
}
Expand Down