Skip to content

Commit

Permalink
Clean up signer
Browse files Browse the repository at this point in the history
  • Loading branch information
gaul committed Oct 27, 2014
1 parent 5742323 commit 559b1d3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/main/java/org/gaul/s3proxy/S3ProxyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -975,17 +975,14 @@ private static String createAuthorizationSignature(

// build string to sign
StringBuilder builder = new StringBuilder()
.append(request.getMethod()).append('\n');
String contentMD5 = request.getHeader(HttpHeaders.CONTENT_MD5);
if (contentMD5 != null) {
builder.append(contentMD5);
}
builder.append('\n');
String contentType = request.getHeader(HttpHeaders.CONTENT_TYPE);
if (contentType != null) {
builder.append(contentType);
}
builder.append('\n');
.append(request.getMethod())
.append('\n')
.append(Strings.nullToEmpty(request.getHeader(
HttpHeaders.CONTENT_MD5)))
.append('\n')
.append(Strings.nullToEmpty(request.getHeader(
HttpHeaders.CONTENT_TYPE)))
.append('\n');
String expires = request.getParameter("Expires");
if (expires != null) {
builder.append(expires);
Expand Down

0 comments on commit 559b1d3

Please sign in to comment.