From 31c1a01b6cf49d39a63110273b79816ae1c58f99 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 25 Apr 2024 21:11:53 +0200 Subject: [PATCH] Send accept-encoding: identity to get correct content-length on head requests --- pulsar/client/transport/curl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar/client/transport/curl.py b/pulsar/client/transport/curl.py index 3d1073f7..242e63ec 100644 --- a/pulsar/client/transport/curl.py +++ b/pulsar/client/transport/curl.py @@ -79,7 +79,7 @@ def post_file(url, path): def get_size(url) -> int: - response = requests.head(url) + response = requests.head(url, headers={"accept-encoding": "identity"}) if response.status_code >= 299: log.warning("Response to HEAD request for '%s' with status code %s, cannot resume download", url, response.status_code) return -1