From 39dad84a9b4cfa353ec3ed60aa8f8856957f6704 Mon Sep 17 00:00:00 2001 From: Jonathan Huot Date: Sat, 18 Aug 2018 01:02:52 +0200 Subject: Remove headers from request attributes --- oauthlib/common.py | 1 - tests/test_common.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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('', 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): -- cgit v1.2.1