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

S3 fixture should report 404 on unknown bucket #31782

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
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ protected Response handle(final Request request) throws IOException {
if (handler != null) {
final String bucket = request.getParam("bucket");
if (bucket != null && permittedBucket.equals(bucket) == false) {
// allow a null bucket to support bucket-free APIs
return newError(request.getId(), RestStatus.FORBIDDEN, "AccessDenied", "Bad bucket", "");
// allow a null bucket to support the multi-object-delete API which
// passes the bucket name in the host header instead of the URL.
if (buckets.containsKey(bucket)) {
return newError(request.getId(), RestStatus.FORBIDDEN, "AccessDenied", "Bad bucket", "");
} else {
return newBucketNotFoundError(request.getId(), bucket);
}
}
return handler.handle(request);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ setup:
---
"Register a repository with a non existing bucket":

- skip:
version: all
reason: to be fixed

- do:
catch: /repository_exception/
snapshot.create_repository:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ setup:
---
"Register a repository with a non existing bucket":

- skip:
version: all
reason: to be fixed

- do:
catch: /repository_exception/
snapshot.create_repository:
Expand Down