Skip to content

Commit

Permalink
Fix the HEAD request to avoid reading file for checksum digest
Browse files Browse the repository at this point in the history
  • Loading branch information
yma96 committed Jun 26, 2024
1 parent 6631535 commit 54dae66
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,14 @@ public Response doHead( final String packageType, final String type, final Strin

responseHelper.setInfoHeaders( builder, item, sk, path, true, contentType,
httpMetadata );

if(!path.endsWith("/")) {
// Content hashing headers
builder.header(ApplicationHeader.md5.key(), contentDigester.digest(sk, path, new EventMetadata()).getDigests().get(ContentDigest.MD5));
builder.header(ApplicationHeader.sha1.key(), contentDigester.digest(sk, path, new EventMetadata()).getDigests().get(ContentDigest.SHA_1));
}


// Remove this to avoid reading file for checksum digest during HEAD request
// if(!path.endsWith("/")) {
// // Content hashing headers
// builder.header(ApplicationHeader.md5.key(), contentDigester.digest(sk, path, new EventMetadata()).getDigests().get(ContentDigest.MD5));
// builder.header(ApplicationHeader.sha1.key(), contentDigester.digest(sk, path, new EventMetadata()).getDigests().get(ContentDigest.SHA_1));
// }

if ( builderModifier != null )
{
builderModifier.accept( builder );
Expand Down

0 comments on commit 54dae66

Please sign in to comment.