You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason #31 does not work seems to be the same problem I have.
I worked on a httpie fork for oauth and httpie is building all requests with:
Content-Type: application/x-www-form-urlencoded; charset=utf-8
The following test in your code will not work correctly as it only test for equality with "Content-Type: application/x-www-form-urlencoded".
Then the POST data will disappear in the signature, here is a simple patch (one line) that's why I'm posting here.
diff --git a/oauth_hook/hook.py b/oauth_hook/hook.py
index b4042fd..3a85a8b 100644
--- a/oauth_hook/hook.py
+++ b/oauth_hook/hook.py
@@ -71,7 +71,7 @@ class OAuthHook(object):
"""
# See issues #10 and #12
if ('Content-Type' not in request.headers or \
- request.headers.get('Content-Type') == 'application/x-www-form-urlencoded') \
+ request.headers.get('Content-Type').startswith('application/x-www-form-urlencoded')) \
and not isinstance(request.data, basestring):
data_and_params = dict(request.data.items() + request.params.items())
The text was updated successfully, but these errors were encountered:
The reason #31 does not work seems to be the same problem I have.
I worked on a httpie fork for oauth and httpie is building all requests with:
Content-Type: application/x-www-form-urlencoded; charset=utf-8
The following test in your code will not work correctly as it only test for equality with "Content-Type: application/x-www-form-urlencoded".
Then the POST data will disappear in the signature, here is a simple patch (one line) that's why I'm posting here.
The text was updated successfully, but these errors were encountered: