Skip to content
Open
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
6 changes: 4 additions & 2 deletions functional/FunctionalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ public static void skipStream(InputStream stream, int len) throws Exception {
public static void handleException(String methodName, String args, long startTime, Exception e)
throws Exception {
if (e instanceof ErrorResponseException) {
if (((ErrorResponseException) e).errorResponse().code().equals("NotImplemented")) {
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
Comment on lines +433 to +434
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinioClient already returns MethodNotAllowed S3 error code for 405 and 501 HTTP status code.

Suggested change
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
if (((ErrorResponseException) e).errorResponse().code().equals("NotImplemented") || (ErrorResponseException) e).errorResponse().code().equals("MethodNotAllowed")) {

mintIgnoredLog(methodName, args, startTime);
return;
}
Expand Down Expand Up @@ -709,7 +710,8 @@ public static void setup() throws Exception {
MakeBucketArgs.builder().bucket(bucketNameWithLock).objectLock(true).build());
} catch (Exception e) {
if (e instanceof ErrorResponseException) {
if (((ErrorResponseException) e).errorResponse().code().equals("NotImplemented")) {
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
Comment on lines +713 to +714
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinioClient already returns MethodNotAllowed S3 error code for 405 and 501 HTTP status code.

Suggested change
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
if (((ErrorResponseException) e).errorResponse().code().equals("NotImplemented") || (ErrorResponseException) e).errorResponse().code().equals("MethodNotAllowed")) {

bucketNameWithLock = null;
return;
}
Expand Down