From af20c37fb2b2eb929e9175ce9b568a636f72d93a Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 6 Nov 2023 13:39:50 -0500 Subject: Only send Content-Length on HTTP 200 We don't want to send 0 during a redirect. Signed-off-by: Andrew Opalach --- src/curl/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3-101-g0448