Skip to content

Commit 6703b9d

Browse files
authored
Fix/unquote etag header (#110)
* fix log message * remove quotes from etag headers * remove extra )
1 parent 7e098d6 commit 6703b9d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

dice-where-downloader-lib/src/main/java/technology/dice/dicewhere/downloader/Download.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected DownloadExecutionResult process(FileAcceptor<?> acceptor, FileSource f
3939
result = processFileDoesNotExist(acceptor, fileSource, pathWritable);
4040
}
4141
LOG.info("A new file was" + (result.isNewFileDownloaded() ? "" : " not") + " downloaded");
42-
LOG.info("Download is " + (!result.isSuccessful() ? "un" : "" + "successful"));
42+
LOG.info("Download is " + (!result.isSuccessful() ? "un" : "") + "successful");
4343
return result;
4444
}
4545

dice-where-downloader-lib/src/main/java/technology/dice/dicewhere/downloader/destination/s3/S3FileAcceptor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ public Optional<MD5Checksum> existingFileMd5() {
112112

113113
try {
114114
final HeadObjectResponse headObjectResponse = client.headObject(headObjectRequest);
115-
return Optional.ofNullable(headObjectResponse.eTag()).map(m -> MD5Checksum.of(m));
115+
return Optional.ofNullable(headObjectResponse.eTag())
116+
.map(m -> MD5Checksum.of(m.replaceAll("\"", "")));
116117
} catch (NoSuchKeyException e) {
117118
return Optional.empty();
118119
}

dice-where-downloader-lib/src/main/java/technology/dice/dicewhere/downloader/source/s3/S3Source.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public FileInfo fileInfo() {
5959
Optional.ofNullable(metadata.get(TIMESTAMP_METADATA_KEY))
6060
.map(m -> Instant.ofEpochMilli(Long.valueOf(m)))
6161
.orElse(Instant.now()),
62-
MD5Checksum.of(headObjectResponse.eTag()),
62+
MD5Checksum.of(headObjectResponse.eTag().replaceAll("\"", "")),
6363
size);
6464
}
6565

0 commit comments

Comments
 (0)