From 4059d2647ed7e26bc20f93d9ebd3c9107ac939ec3c9c4a5229b107015e6ae331 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 5 Aug 2022 08:32:11 +0000 Subject: [PATCH] - Add transfer-encoding-lower-case.patch to fix failing tests due to incorrect capitalization of the 'transfer-encoding' header (gh#encode/httpx!1735). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpx?expand=0&rev=11 --- python-httpx.changes | 7 +++ python-httpx.spec | 4 ++ transfer-encoding-lower-case.patch | 84 ++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 transfer-encoding-lower-case.patch diff --git a/python-httpx.changes b/python-httpx.changes index cc98d3e..9dc2e69 100644 --- a/python-httpx.changes +++ b/python-httpx.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Aug 5 08:30:50 UTC 2022 - Matej Cepl + +- Add transfer-encoding-lower-case.patch to fix failing tests due + to incorrect capitalization of the 'transfer-encoding' header + (gh#encode/httpx!1735). + ------------------------------------------------------------------- Tue Jul 19 15:45:42 UTC 2022 - Ben Greiner diff --git a/python-httpx.spec b/python-httpx.spec index 81cf663..c9d586b 100644 --- a/python-httpx.spec +++ b/python-httpx.spec @@ -32,6 +32,10 @@ Summary: Python HTTP client with async support License: BSD-3-Clause URL: https://github.com/encode/httpx Source: https://github.com/encode/httpx/archive/%{version}.tar.gz#/httpx-%{version}.tar.gz +# PATCH-FIX-UPSTREAM transfer-encoding-lower-case.patch mcepl@suse.com +# Reported upstream as gh#encode/httpx!2332 +# name of HTTP headers are lower-case +Patch0: transfer-encoding-lower-case.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools} BuildRequires: fdupes diff --git a/transfer-encoding-lower-case.patch b/transfer-encoding-lower-case.patch new file mode 100644 index 0000000..d979cac --- /dev/null +++ b/transfer-encoding-lower-case.patch @@ -0,0 +1,84 @@ +--- + tests/test_main.py | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/tests/test_main.py ++++ b/tests/test_main.py +@@ -29,7 +29,7 @@ def test_get(server): + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: text/plain", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + "Hello, world!", + ] +@@ -44,7 +44,7 @@ def test_json(server): + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: application/json", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + "{", + '"Hello": "world!"', +@@ -62,7 +62,7 @@ def test_binary(server): + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: application/octet-stream", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + f"<{len(content)} bytes of binary data>", + ] +@@ -77,7 +77,7 @@ def test_redirects(server): + "HTTP/1.1 301 Moved Permanently", + "server: uvicorn", + "location: /", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + ] + +@@ -91,12 +91,12 @@ def test_follow_redirects(server): + "HTTP/1.1 301 Moved Permanently", + "server: uvicorn", + "location: /", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: text/plain", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + "Hello, world!", + ] +@@ -111,7 +111,7 @@ def test_post(server): + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: text/plain", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + '{"hello": "world"}', + ] +@@ -135,7 +135,7 @@ def test_verbose(server): + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: text/plain", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + "Hello, world!", + ] +@@ -161,7 +161,7 @@ def test_auth(server): + "HTTP/1.1 200 OK", + "server: uvicorn", + "content-type: text/plain", +- "Transfer-Encoding: chunked", ++ "transfer-encoding: chunked", + "", + "Hello, world!", + ]