Skip to content

Commit 1309bad

Browse files
committed
Always set proper 'Host' header
would default to localhost:80 otherwise and that confuses e.g. Google App Engine
1 parent 32db3f5 commit 1309bad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/HttpLibrary/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Context(object):
3737
def __init__(self, http, host=None):
3838
# daddy
3939
self._http = http
40+
self._host = host
4041

4142
# the livetest app
4243
if host:
@@ -85,6 +86,8 @@ def post_process_request(self, response):
8586
# fail
8687
self.next_request_should = True
8788
self.request_headers = {}
89+
if self._host != None:
90+
self.request_headers['Host'] = self._host
8891
self.request_body = None
8992

9093
# check flag set by "Next Request Should Succeed"

0 commit comments

Comments
 (0)