From 4a52a71956a8d46fcb7294ac71734504bb09bcc2 Mon Sep 17 00:00:00 2001 From: S. Solomon Darnell Date: Fri, 28 Mar 2025 21:52:21 -0500 Subject: two version of R2R are here --- .../requests_oauthlib/compliance_fixes/weibo.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .venv/lib/python3.12/site-packages/requests_oauthlib/compliance_fixes/weibo.py (limited to '.venv/lib/python3.12/site-packages/requests_oauthlib/compliance_fixes/weibo.py') diff --git a/.venv/lib/python3.12/site-packages/requests_oauthlib/compliance_fixes/weibo.py b/.venv/lib/python3.12/site-packages/requests_oauthlib/compliance_fixes/weibo.py new file mode 100644 index 00000000..f1623fd6 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/requests_oauthlib/compliance_fixes/weibo.py @@ -0,0 +1,13 @@ +from json import loads, dumps + + +def weibo_compliance_fix(session): + def _missing_token_type(r): + token = loads(r.text) + token["token_type"] = "Bearer" + r._content = dumps(token).encode() + return r + + session._client.default_token_placement = "query" + session.register_compliance_hook("access_token_response", _missing_token_type) + return session -- cgit 1.4.1