Normalize HTTP header names to title case

The spec says they are case insensitive, so this is just for
consistency (with eg. Chrome).
This commit is contained in:
Tor Arne Vestbø 2016-01-07 21:47:30 +01:00
parent 604fe68414
commit 603b1d8f57

View file

@ -60,9 +60,9 @@ class PyiCloudService(object):
self.session = requests.Session() self.session = requests.Session()
self.session.verify = verify self.session.verify = verify
self.session.headers.update({ self.session.headers.update({
'host': 'setup.icloud.com', 'Host': 'setup.icloud.com',
'origin': self._home_endpoint, 'Origin': self._home_endpoint,
'referer': '%s/' % self._home_endpoint, 'Referer': '%s/' % self._home_endpoint,
'User-Agent': 'Opera/9.52 (X11; Linux i686; U; en)' 'User-Agent': 'Opera/9.52 (X11; Linux i686; U; en)'
}) })