Skip to content

Commit

Permalink
Respond with unsupported message when GetBucketLocation
Browse files Browse the repository at this point in the history
### What changes are proposed in this pull request?
Respond with unsupported message when GetBucketLocation

### Why are the changes needed?
Alluxio proxy doesn't support GetBucketLocation request, so we need to return 'Not Implemented' error code.

### Does this PR introduce any user facing changes?

Please list the user-facing changes introduced by your change, including
  1. change in user-facing APIs
  2. addition or removal of property keys
  3. webui

			pr-link: #18416
			change-id: cid-05c70148361e293e6583ddb6abda93eb2c530496
  • Loading branch information
Jackson-Wang-7 authored and alluxio-bot committed Nov 21, 2023
1 parent c3ce6aa commit 0909f3a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ public Response headBucket(
* @param acl query string to indicate if this is for GetBucketAcl
* @param policy query string to indicate if this is for GetBucketPolicy
* @param policyStatus query string to indicate if this is for GetBucketPolicyStatus
* @param location query parameter to indicate if this is for GetBucketLocation
* @param uploads query string to indicate if this is for ListMultipartUploads
* @return the response object
*/
Expand All @@ -306,6 +307,7 @@ public Response getBucket(@HeaderParam("Authorization") final String authorizati
@QueryParam("acl") final String acl,
@QueryParam("policy") final String policy,
@QueryParam("policyStatus") final String policyStatus,
@QueryParam("location") final String location,
@QueryParam("uploads") final String uploads) {
return S3RestUtils.call(bucket, () -> {
Preconditions.checkNotNull(bucket, "required 'bucket' parameter is missing");
Expand All @@ -327,6 +329,12 @@ public Response getBucket(@HeaderParam("Authorization") final String authorizati
"GetBucketpolicyStatus is not currently supported.",
S3ErrorCode.INTERNAL_ERROR.getStatus()));
}
if (location != null) {
throw new S3Exception(bucket, new S3ErrorCode(
S3ErrorCode.NOT_IMPLEMENTED.getCode(),
"GetBucketLocation is not currently supported.",
S3ErrorCode.NOT_IMPLEMENTED.getStatus()));
}

String path = S3RestUtils.parsePath(AlluxioURI.SEPARATOR + bucket);
final String user = getUser(authorization);
Expand Down

0 comments on commit 0909f3a

Please sign in to comment.