summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2023-11-06 13:39:50 -0500
committerAndrew Opalach <andrew@akon.city> 2023-11-06 13:39:50 -0500
commitaf20c37fb2b2eb929e9175ce9b568a636f72d93a (patch)
treeac2b1663d3c2bc2f0fe83a39c2793e33a940d451 /src
parent1517f2874ab44fcf210c14e9fdd3f9c1bfd6ba76 (diff)
downloadlibnaunet-af20c37fb2b2eb929e9175ce9b568a636f72d93a.tar.gz
libnaunet-af20c37fb2b2eb929e9175ce9b568a636f72d93a.tar.bz2
libnaunet-af20c37fb2b2eb929e9175ce9b568a636f72d93a.zip
Only send Content-Length on HTTP 200
We don't want to send 0 during a redirect. Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src')
-rw-r--r--src/curl/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/curl/http.c b/src/curl/http.c
index ecdec2d..ef42c35 100644
--- a/src/curl/http.c
+++ b/src/curl/http.c
@@ -11,7 +11,7 @@ static void check_status_codes(struct aki_curl *curl)
http->callback(http->userdata, AKI_HTTP_RESPONSE_CODE, NULL, http->response_code);
}
}
- if (http->response_code > 0 && http->content_length < 0) {
+ if (http->response_code == 200 && http->content_length < 0) {
curl_easy_getinfo(curl->handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &http->content_length);
if (http->content_length >= 0) {
http->callback(http->userdata, AKI_HTTP_CONTENT_LENGTH, NULL, (s64)http->content_length);