From 5742b48a35b8ee10d176f99b5863428525a16eac Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Sun, 12 Mar 2023 16:27:35 -0300 Subject: [PATCH] framework/replay: Fix Content-Length header name Reviewed-by: Guilherme Gallo Part-of: --- framework/replay/download_utils.py | 2 +- unittests/framework/replay/test_download_utils.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/replay/download_utils.py b/framework/replay/download_utils.py index fce2a4cfe..5c5c89128 100644 --- a/framework/replay/download_utils.py +++ b/framework/replay/download_utils.py @@ -197,7 +197,7 @@ def verify_file_integrity(file_path: str, headers: Any, local_file_checksums: An "Fall back to Content-length verification.") try: - remote_file_size = int(headers["Content-length"]) + remote_file_size = int(headers["Content-Length"]) except KeyError: print("Error getting Content-Length from server. " "Skipping file size check.") diff --git a/unittests/framework/replay/test_download_utils.py b/unittests/framework/replay/test_download_utils.py index 28b886b5d..4cae09c59 100644 --- a/unittests/framework/replay/test_download_utils.py +++ b/unittests/framework/replay/test_download_utils.py @@ -69,12 +69,12 @@ class MockedResponse: binary_data_md5: str = md5(MockedResponseData.binary_data).hexdigest() etag: dict[str, str] = {"etag": binary_data_md5} length: dict[str, Any] = { - "ContextLength": str(len(MockedResponseData.binary_data)) + "Content-Length": str(len(MockedResponseData.binary_data)) } return { - "With ContextLength": length, + "With Content-Length": length, "With etag": etag, - "With ContextLength and etag": {**length, **etag}, + "With Content-Length and etag": {**length, **etag}, "Without integrity headers": {}, } -- 2.11.4.GIT