feat(registry,daemon): ETag downloads; report pending changes
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 4s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 11s

This commit is contained in:
faumaray committed 2026-12-04 05:57:16 +03:00
1 parent fdfab9277b
commit 85ff7a8c75
8 files changed
+65 -3

No files matched your search

+16 -2
View File
@@ -871,8 +871,22 @@ VOID_TEST(RegistryTests, registry_binary_variant_publish_download_and_materializ
if (downloaded) {
Void::Testing::expect(downloaded->body == artifact);
}
auto ranged =
send_loopback_http(port, "GET", binary_path + "/download", {{"Range", "bytes=0-3"}});
auto etag_head = send_loopback_http(port, "GET", binary_path + "/download");
Void::Testing::expect(etag_head.has_value() && etag_head->status == 200);
if (etag_head) {
const auto etag_it = etag_head->headers.find("etag");
Void::Testing::expect(etag_it != etag_head->headers.end());
if (etag_it != etag_head->headers.end()) {
auto cached = send_loopback_http(port, "GET", binary_path + "/download",
{{"If-None-Match", etag_it->second}});
Void::Testing::expect(cached.has_value() && cached->status == 304);
if (cached) {
Void::Testing::expect(cached->body.empty());
}
}
}
auto ranged = send_loopback_http(port, "GET", binary_path + "/download",
{{"Range", "bytes=0-3"}});
Void::Testing::expect(ranged.has_value() && ranged->status == 206);
if (ranged) {
Void::Testing::expect_eq(ranged->body, artifact.substr(0, 4));