Skip to content

Commit

Permalink
Merge pull request #187 from /issues/186
Browse files Browse the repository at this point in the history
Wrong Signature Error Message (MISC-49)
  • Loading branch information
jakobvogel committed Oct 4, 2021
2 parents 1ea50a5 + e14c5f6 commit 248ab92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/main/java/ninja/S3Dispatcher.java
Expand Up @@ -589,10 +589,11 @@ private boolean objectCheckAuth(WebContext webContext, Bucket bucket, String key
errorSynthesizer.synthesiseError(webContext,
bucket.getName(),
key,
S3ErrorCode.BadDigest,
Strings.apply("Invalid Hash (Expected: %s, Found: %s)",
expectedHash,
hash));
S3ErrorCode.SignatureDoesNotMatch,
Strings.apply(
"The computed request signature does not match the one provided. Check login credentials. (Expected: %s, Found: %s)",
expectedHash,
hash));
log.log(webContext.getRequest().method().name(),
webContext.getRequestedURI(),
APILog.Result.REJECTED,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ninja/errors/S3ErrorCode.java
Expand Up @@ -20,7 +20,7 @@ public enum S3ErrorCode {
InvalidDigest(HttpResponseStatus.BAD_REQUEST), InvalidRequest(HttpResponseStatus.BAD_REQUEST),
NoSuchBucket(HttpResponseStatus.NOT_FOUND), NoSuchBucketPolicy(HttpResponseStatus.NOT_FOUND),
NoSuchKey(HttpResponseStatus.NOT_FOUND), NoSuchLifecycleConfiguration(HttpResponseStatus.NOT_FOUND),
NoSuchUpload(HttpResponseStatus.NOT_FOUND);
NoSuchUpload(HttpResponseStatus.NOT_FOUND), SignatureDoesNotMatch(HttpResponseStatus.FORBIDDEN);

private final HttpResponseStatus httpStatusCode;

Expand Down

0 comments on commit 248ab92

Please sign in to comment.