diff options
author | Jonathan Huot <JonathanHuot@users.noreply.github.com> | 2018-08-20 23:56:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 23:56:59 +0200 |
commit | 8cb3d7210132d7c94672a86468c3df3b6ef12c6a (patch) | |
tree | f261b3272c06d51812e330138a7ac9795fc58356 | |
parent | ce3639e0dd9d02830ba965a2e9cd32fcca55641d (diff) | |
parent | 85e65fefb08a496b30503b2da3c75d7283d5cc03 (diff) | |
download | oauthlib-8cb3d7210132d7c94672a86468c3df3b6ef12c6a.tar.gz |
Merge pull request #576 from oauthlib/409_headers_not_params
Remove headers from request attributes
-rw-r--r-- | oauthlib/common.py | 1 | ||||
-rw-r--r-- | tests/test_common.py | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/oauthlib/common.py b/oauthlib/common.py index c1180e6..6364761 100644 --- a/oauthlib/common.py +++ b/oauthlib/common.py @@ -426,7 +426,6 @@ class Request(object): } self._params.update(dict(urldecode(self.uri_query))) self._params.update(dict(self.decoded_body or [])) - self._params.update(self.headers) def __getattr__(self, name): if name in self._params: diff --git a/tests/test_common.py b/tests/test_common.py index fb4bd5b..f239368 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -214,6 +214,11 @@ class RequestTest(TestCase): self.assertNotIn('bar', repr(r)) self.assertIn('<SANITIZED>', repr(r)) + def test_headers_params(self): + r = Request(URI, headers={'token': 'foobar'}, body='token=banana') + self.assertEqual(r.headers['token'], 'foobar') + self.assertEqual(r.token, 'banana') + class CaseInsensitiveDictTest(TestCase): |