From 81a9b22cdb6199f5a44eb8d047a67e146da444e7 Mon Sep 17 00:00:00 2001 From: dongjiao Date: Sat, 11 May 2024 14:55:27 +0800 Subject: [PATCH] bugfix:remove erroneous charset param from Content-Type header --- ...arset-param-from-Content-Type-header.patch | 35 +++++++++++++++++++ python-requests-oauthlib.spec | 8 +++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 backport-remove-erroneous-charset-param-from-Content-Type-header.patch diff --git a/backport-remove-erroneous-charset-param-from-Content-Type-header.patch b/backport-remove-erroneous-charset-param-from-Content-Type-header.patch new file mode 100644 index 0000000..2c3dc6f --- /dev/null +++ b/backport-remove-erroneous-charset-param-from-Content-Type-header.patch @@ -0,0 +1,35 @@ +From 2a2ef2e670d11ee943d98044f548f0a24e27f8ba Mon Sep 17 00:00:00 2001 +From: Pat Patterson +Date: Wed, 27 Jan 2021 09:01:23 -0800 +Subject: [PATCH] Fix for #437 - remove erroneous charset param from + Content-Type header + +--- + requests_oauthlib/oauth2_session.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/requests_oauthlib/oauth2_session.py b/requests_oauthlib/oauth2_session.py +index bfec8e8..fad07f6 100644 +--- a/requests_oauthlib/oauth2_session.py ++++ b/requests_oauthlib/oauth2_session.py +@@ -325,7 +325,7 @@ class OAuth2Session(requests.Session): + + headers = headers or { + "Accept": "application/json", +- "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", ++ "Content-Type": "application/x-www-form-urlencoded", + } + self.token = {} + request_kwargs = {} +@@ -426,7 +426,7 @@ class OAuth2Session(requests.Session): + if headers is None: + headers = { + "Accept": "application/json", +- "Content-Type": ("application/x-www-form-urlencoded;charset=UTF-8"), ++ "Content-Type": ("application/x-www-form-urlencoded"), + } + + r = self.post( +-- +2.27.0 + diff --git a/python-requests-oauthlib.spec b/python-requests-oauthlib.spec index b3ba0f0..3aa0c1c 100644 --- a/python-requests-oauthlib.spec +++ b/python-requests-oauthlib.spec @@ -1,11 +1,12 @@ %global _empty_manifest_terminate_build 0 Name: python-requests-oauthlib Version: 1.3.1 -Release: 1 +Release: 2 Summary: OAuthlib authentication support for Requests. License: ISC URL: https://github.com/requests/requests-oauthlib Source0: https://files.pythonhosted.org/packages/95/52/531ef197b426646f26b53815a7d2a67cb7a331ef098bb276db26a68ac49f/requests-oauthlib-1.3.1.tar.gz +Patch0: backport-remove-erroneous-charset-param-from-Content-Type-header.patch BuildArch: noarch %description @@ -26,7 +27,7 @@ Provides: python3-requests-oauthlib-doc This project provides first-class OAuth library support for `Requests `. %prep -%autosetup -n requests-oauthlib-1.3.1 +%autosetup -p1 -n requests-oauthlib-1.3.1 %build %py3_build @@ -66,6 +67,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Sat May 11 2024 dongjiao - 1.3.1-2 +- bugfix:remove erroneous charset param from Content-Type header + * Thu Jun 16 2022 OpenStack_SIG - 1.3.1-1 - Upgrade version for openstack yoga