Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions oauth_hook/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,15 @@ def __call__(self, request):
request.oauth_params['oauth_version'] = self.OAUTH_VERSION
if self.token:
request.oauth_params['oauth_token'] = self.token.key
if 'oauth_verifier' in request.data:
request.oauth_params['oauth_verifier'] = request.data.pop('oauth_verifier')
request.oauth_params['oauth_signature_method'] = self.signature.name

# oauth_callback is an special parameter, we remove it out of the body
# these are special parameters, so we remove them from the body
# If it needs to go in the body, it will be overwritten later, otherwise not
if 'oauth_callback' in request.data:
request.oauth_params['oauth_callback'] = request.data.pop('oauth_callback')
if 'oauth_callback' in request.params:
request.oauth_params['oauth_callback'] = request.params.pop('oauth_callback')
for key in ['oauth_callback', 'oauth_session_handle', 'oauth_verifier']:
if key in request.data:
request.oauth_params[key] = request.data.pop(key)
if key in request.params:
request.oauth_params[key] = request.params.pop(key)

request.data_and_params = request.oauth_params.copy()
request.oauth_params['oauth_signature'] = self.signature.sign(request, self.consumer, self.token)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup, find_packages

version = '0.4.1'
version = '0.4.2'

setup(
name='requests-oauth',
Expand Down