File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,6 @@ python-dateutil
4
4
responses
5
5
mock
6
6
setuptools_scm
7
+ MarkupSafe
8
+ setuptools >= 40.0
9
+ configparser >= 3.5
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ def __init__(self,
29
29
self ._access_token = access_token
30
30
self ._access_token_secret = access_token_secret
31
31
self ._options = kwargs .get ('options' , {})
32
+ self ._headers = kwargs .get ('headers' , {})
32
33
33
34
def __repr__ (self ):
34
35
return '<{name} object at {mem} consumer_key={key}>' .format (
@@ -42,6 +43,11 @@ def options(self):
42
43
"""Returns the options value."""
43
44
return self ._options
44
45
46
+ @property
47
+ def headers (self ):
48
+ """Returns the headers value."""
49
+ return self ._headers
50
+
45
51
@property
46
52
def consumer_key (self ):
47
53
"""Returns the consumer_key value."""
Original file line number Diff line number Diff line change @@ -75,10 +75,12 @@ def __oauth_request(self):
75
75
if 'headers' in self .options :
76
76
headers .update (self .options ['headers' ].copy ())
77
77
78
- # internal-only
78
+ # DEPRECATED: internal-only (Should pass a header to the client)
79
79
if 'x-as-user' in self ._client .options :
80
80
headers ['x-as-user' ] = self ._client .options .get ('x-as-user' )
81
-
81
+ # Add headers from the client to the request (Client headers take priority)
82
+ for key , val in self ._client .headers .items ():
83
+ headers [key ] = val
82
84
params = self .options .get ('params' , None )
83
85
data = self .options .get ('body' , None )
84
86
files = self .options .get ('files' , None )
You can’t perform that action at this time.
0 commit comments