kopia lustrzana https://github.com/gaul/s3proxy
Throw proper S3 error code for invalid buck name
INVALID_BUCKET_NAME for container creation request, else NO_SUCH_BUCKETpull/207/merge
rodzic
6b92cc06f4
commit
84885fa8cd
|
@ -559,8 +559,15 @@ public class S3ProxyHandler {
|
|||
}
|
||||
}
|
||||
|
||||
// Validate container name
|
||||
if (!uri.equals("/") && !isValidContainer(path[1])) {
|
||||
throw new S3Exception(S3ErrorCode.INVALID_BUCKET_NAME);
|
||||
if (method.equals("PUT") &&
|
||||
(path.length <= 2 || path[2].isEmpty()) &&
|
||||
!("".equals(request.getParameter("acl")))) {
|
||||
throw new S3Exception(S3ErrorCode.INVALID_BUCKET_NAME);
|
||||
} else {
|
||||
throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET);
|
||||
}
|
||||
}
|
||||
|
||||
String uploadId = request.getParameter("uploadId");
|
||||
|
|
Ładowanie…
Reference in New Issue