Avoid NullPointerException when quoting ETags

pull/139/merge
Andrew Gaul 2016-05-27 18:06:05 -07:00
rodzic a4b96924eb
commit e7bb6ddb47
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -1273,8 +1273,9 @@ final class S3ProxyHandler extends AbstractHandler {
long ifUnmodifiedSince = request.getDateHeader(
HttpHeaders.IF_UNMODIFIED_SINCE);
String eTag = maybeQuoteETag(metadata.getETag());
String eTag = metadata.getETag();
if (eTag != null) {
eTag = maybeQuoteETag(eTag);
if (ifMatch != null && !ifMatch.equals(eTag)) {
throw new S3Exception(S3ErrorCode.PRECONDITION_FAILED);
}
@ -2047,8 +2048,9 @@ final class S3ProxyHandler extends AbstractHandler {
"x-amz-copy-source-if-none-match");
long ifUnmodifiedSince = request.getDateHeader(
"x-amz-copy-source-if-unmodified-since");
String eTag = maybeQuoteETag(blobMetadata.getETag());
String eTag = blobMetadata.getETag();
if (eTag != null) {
eTag = maybeQuoteETag(eTag);
if (ifMatch != null && !ifMatch.equals(eTag)) {
throw new S3Exception(S3ErrorCode.PRECONDITION_FAILED);
}