Skip to content

Commit 36140bf

Browse files
authored
feat(storage): respect com.google.cloud.storage.Hasher.read system property in JSON read paths (#13526)
This PR changes the checksum verification on JSON read paths to use `Hasher.readHasher()` instead of `Hasher.defaultHasher()`. This respects the system property `com.google.cloud.storage.Hasher.read` to allow disabling of client-side checksums on JSON read paths. [Generated-by: AI]
1 parent 04396b2 commit 36140bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpDownloadSessionBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static final class ReadableByteChannelSessionBuilder {
5858

5959
private ReadableByteChannelSessionBuilder(BlobReadChannelContext blobReadChannelContext) {
6060
this.blobReadChannelContext = blobReadChannelContext;
61-
this.hasher = Hasher.defaultHasher();
61+
this.hasher = Hasher.readHasher();
6262
this.autoGzipDecompression = false;
6363
}
6464

java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpStorageRpcHasherHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class HttpStorageRpcHasherHelper {
4040
private final Hasher hasher;
4141

4242
private HttpStorageRpcHasherHelper() {
43-
hasher = Hasher.defaultHasher();
43+
hasher = Hasher.readHasher();
4444
}
4545

4646
/**

0 commit comments

Comments
 (0)