Skip to content

Commit

Permalink
Copy default request kwargs before manipulating.
Browse files Browse the repository at this point in the history
  • Loading branch information
thedodd committed Jul 26, 2015
1 parent 5fc74db commit a99ce1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion objectrocket/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Authentication operations."""
import copy
import logging
import requests

Expand Down Expand Up @@ -62,7 +63,7 @@ def authenticate(self, username, password):
@property
def _default_request_kwargs(self):
"""The default request keyword arguments to be passed to the requests library."""
return super(Auth, self)._default_request_kwargs
return copy.deepcopy(super(Auth, self)._default_request_kwargs)

@property
def _password(self):
Expand Down
3 changes: 2 additions & 1 deletion objectrocket/instances/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Instance operations and instances."""
import copy
import json
import logging

Expand Down Expand Up @@ -145,7 +146,7 @@ def _get_response_data(self, response):
@property
def _default_request_kwargs(self):
"""The default request keyword arguments to be passed to the requests library."""
default_kwargs = super(Instances, self)._default_request_kwargs
default_kwargs = copy.deepcopy(super(Instances, self)._default_request_kwargs)
default_kwargs.setdefault('headers', {}).update({
'X-Auth-Token': self._client.auth._token
})
Expand Down

0 comments on commit a99ce1c

Please sign in to comment.