Skip to content

Commit

Permalink
Merge pull request #441 from jamhall/439-location-method-stub
Browse files Browse the repository at this point in the history
Report NotImplemented for stubbed routes
  • Loading branch information
kherock committed Apr 17, 2019
2 parents de7c5a3 + 25c8204 commit fc30f3e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
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

0 comments on commit fc30f3e

Please sign in to comment.