diff options
| author | Dan Engelbrecht <[email protected]> | 2025-10-20 15:27:03 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-20 15:27:03 +0200 |
| commit | e0160f8871f7ddcf780ea4554fc052a8c8e0ed51 (patch) | |
| tree | 58cab9168536ac786628b03e40d4e57d6e22bb3d | |
| parent | silence warnings in CprHttpClient if request was aborted (#591) (diff) | |
| download | zen-e0160f8871f7ddcf780ea4554fc052a8c8e0ed51.tar.xz zen-e0160f8871f7ddcf780ea4554fc052a8c8e0ed51.zip | |
fix jupiter payload validation with allow redirect (#594)
* don't validate compressed buffer payload if a range is requested
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenremotestore/jupiter/jupitersession.cpp | 13 |
2 files changed, 9 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a9ff201..516b24f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Bugfix: Fix ASSERT after running `zen workspace info` on a non-existing workspace - Bugfix: Fixed issue where GC could start after shutdown of GC had been requested causing a race - Bugfix: Storage stats of builds on dashboard start page fixed +- Bugfix: Fixed ASSERT when `zen builds download` `--allow-redirect` was enabled and downloading partial block ranges ## 5.7.6 - Improvement: Oidc token executable is now launched hidden when launch from inside zenserver (oplog import/export) diff --git a/src/zenremotestore/jupiter/jupitersession.cpp b/src/zenremotestore/jupiter/jupitersession.cpp index 942e2a9dc..6a7938e7f 100644 --- a/src/zenremotestore/jupiter/jupitersession.cpp +++ b/src/zenremotestore/jupiter/jupitersession.cpp @@ -780,11 +780,14 @@ JupiterSession::GetBuildBlob(std::string_view Namespace, { IoHash ValidateRawHash; uint64_t ValidateRawSize = 0; - ZEN_ASSERT_SLOW(CompressedBuffer::ValidateCompressedHeader(Response.ResponsePayload, ValidateRawHash, ValidateRawSize)); - ZEN_ASSERT_SLOW(ValidateRawHash == Hash); - ZEN_ASSERT_SLOW(ValidateRawSize > 0); - ZEN_UNUSED(ValidateRawHash, ValidateRawSize); - Response.ResponsePayload.SetContentType(ZenContentType::kCompressedBinary); + if (!Headers.Entries.contains("Range")) + { + ZEN_ASSERT_SLOW(CompressedBuffer::ValidateCompressedHeader(Response.ResponsePayload, ValidateRawHash, ValidateRawSize)); + ZEN_ASSERT_SLOW(ValidateRawHash == Hash); + ZEN_ASSERT_SLOW(ValidateRawSize > 0); + ZEN_UNUSED(ValidateRawHash, ValidateRawSize); + Response.ResponsePayload.SetContentType(ZenContentType::kCompressedBinary); + } } } return detail::ConvertResponse(Response, "JupiterSession::GetBuildBlob"sv); |