You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My entity is https://scott.mn. My server (right now) is http://tent.toxicsli.me. I found that the last step of auth (exchanging code for an access token) was failing because python-tent-client was making the request to http://scott.mn. This change fixed it:
--- tentapp.py.orig 2012-12-06 17:59:36.653636916 -0600+++ tentapp.py 2012-12-06 17:59:28.529637767 -0600@@ -210,7 +210,6 @@
# we don't have auth keys yet, so make a non-auth session.
# if authenticate is run later, this session will be replaced with a session that does authentication
headers = dict(DEFAULT_HEADERS)
- headers['Host'] = urlparse(self.entityUrl).netloc
self.session = requests.session(hooks={"pre_request": self._authHook}, headers=headers)
# this list of api roots will be filled in by _discoverAPIurls()
@@ -220,7 +219,6 @@
# now that we've run discovery, the entityUrl might have changed
# so we have to make a new session again.
headers = dict(DEFAULT_HEADERS)
- headers['Host'] = urlparse(self.entityUrl).netloc
self.session = requests.session(hooks={"pre_request": self._authHook}, headers=headers)
Now I'm wondering why the Host header was explicitly set in the first place. Everything seems to work without it, but is there something I'm missing? Why would you explicitly set the Host header rather than leave it up to Requests?
The text was updated successfully, but these errors were encountered:
My entity is
https://scott.mn
. My server (right now) ishttp://tent.toxicsli.me
. I found that the last step of auth (exchangingcode
for an access token) was failing because python-tent-client was making the request tohttp://scott.mn
. This change fixed it:Now I'm wondering why the Host header was explicitly set in the first place. Everything seems to work without it, but is there something I'm missing? Why would you explicitly set the Host header rather than leave it up to Requests?
The text was updated successfully, but these errors were encountered: