From f6498af0d7618c580ecfbc77aff9946362efe4f3 Mon Sep 17 00:00:00 2001 From: Bharat Viswanadham Date: Mon, 22 Oct 2018 10:17:12 -0700 Subject: [PATCH] HDDS-705. addendum patch to fix find bug issue. Contributed by Bharat Viswanadham. --- .../org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java | 4 +++- .../org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java index c6b4e6672c..148bf69076 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java @@ -185,8 +185,10 @@ public String parseUsername( LOG.info("Auth header string {}", auth); if (auth == null) { + // In this case, adding resource as Authorization, need to revisit in + // future if it needs to be changed. throw S3ErrorTable - .newError(S3ErrorTable.MALFORMED_HEADER, auth); + .newError(S3ErrorTable.MALFORMED_HEADER, "Authorization"); } String userName; diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java index 9d0f76742c..b5c6c72422 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java @@ -50,7 +50,7 @@ private S3ErrorTable() { "is invalid.", HTTP_NOT_FOUND); public static final OS3Exception NO_SUCH_KEY = new OS3Exception( - "NoSuchObject", "The specified key does not exist", HTTP_NOT_FOUND); + "NoSuchKey", "The specified key does not exist", HTTP_NOT_FOUND); /** * Create a new instance of Error.