feat(registry): support single-range downloads; extend install tests
This commit is contained in:
1 parent
3fa7ab086f
commit
c6436a8010
7 files changed
+345
-17
No files matched your search
@@ -857,6 +857,17 @@ 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"}});
|
||||
Void::Testing::expect(ranged.has_value() && ranged->status == 206);
|
||||
if (ranged) {
|
||||
Void::Testing::expect_eq(ranged->body, artifact.substr(0, 4));
|
||||
Void::Testing::expect(ranged->headers.at("content-range").find("/" +
|
||||
std::to_string(artifact.size())) != std::string::npos);
|
||||
}
|
||||
auto unsatisfiable = send_loopback_http(port, "GET", binary_path + "/download",
|
||||
{{"Range", "bytes=999999-"}});
|
||||
Void::Testing::expect(unsatisfiable.has_value() && unsatisfiable->status == 416);
|
||||
auto head_binary = send_loopback_http(port, "HEAD", binary_path + "/download");
|
||||
Void::Testing::expect(head_binary.has_value() && head_binary->status == 200);
|
||||
if (head_binary) {
|
||||
|
||||
Reference in new issue
Block a user