aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-04-10 18:07:29 +0200
committerDan Engelbrecht <[email protected]>2025-04-10 18:07:29 +0200
commita57abfc7dabd78e25483f30d97c3fb86c94d42f8 (patch)
tree28e03e2ebb1e01b0daf898b70b79742c5606b086 /src
parentfall back to FindFirstFile if access prevents us from using GetFileAttributes (diff)
downloadzen-a57abfc7dabd78e25483f30d97c3fb86c94d42f8.tar.xz
zen-a57abfc7dabd78e25483f30d97c3fb86c94d42f8.zip
only validate hash if we have a complete payload in http client
Diffstat (limited to 'src')
-rw-r--r--src/zenhttp/httpclient.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index f3baf37ce..763f3262a 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -410,6 +410,11 @@ ValidatePayload(cpr::Response& Response, std::unique_ptr<detail::TempPayloadFile
}
}
+ if (Response.status_code == (long)HttpResponseCode::PartialContent)
+ {
+ return true;
+ }
+
if (auto JupiterHash = Response.header.find("X-Jupiter-IoHash"); JupiterHash != Response.header.end())
{
IoHash ExpectedPayloadHash;
@@ -427,11 +432,6 @@ ValidatePayload(cpr::Response& Response, std::unique_ptr<detail::TempPayloadFile
}
}
- if (Response.status_code == (long)HttpResponseCode::PartialContent)
- {
- return true;
- }
-
if (auto ContentType = Response.header.find("Content-Type"); ContentType != Response.header.end())
{
if (ContentType->second == "application/x-ue-comp")