Skip to content

Commit

Permalink
Do not raise ValueError any longer if a GET request has urlencoded bo…
Browse files Browse the repository at this point in the history
…dy params
  • Loading branch information
bryanhelmig committed Mar 5, 2020
1 parent 9e824cf commit ae8c4ec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion oauthlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
from logging import NullHandler

__author__ = 'The OAuthlib Community'
__version__ = '3.0.2'
__version__ = '3.0.2.zapier'

logging.getLogger('oauthlib').addHandler(NullHandler())
9 changes: 0 additions & 9 deletions oauthlib/oauth1/rfc5849/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,6 @@ def sign(self, uri, http_method='GET', body=None, headers=None, realm=None):
raise ValueError(
'Body signatures may only be used with form-urlencoded content')

# We amend https://tools.ietf.org/html/rfc5849#section-3.4.1.3.1
# with the clause that parameters from body should only be included
# in non GET or HEAD requests. Extracting the request body parameters
# and including them in the signature base string would give semantic
# meaning to the body, which it should not have according to the
# HTTP 1.1 spec.
elif http_method.upper() in ('GET', 'HEAD') and has_params:
raise ValueError('GET/HEAD requests should not include body.')

# generate the basic OAuth parameters
request.oauth_params = self.get_oauth_params(request)

Expand Down

0 comments on commit ae8c4ec

Please sign in to comment.