Skip to content

Commit e266f9e

Browse files
committed
Revert "Proper handling HTTP Host header"
This reverts commit b095d43.
1 parent 84ebcca commit e266f9e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

py/selenium/webdriver/remote/remote_connection.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ def __init__(self, remote_server_addr, keep_alive=False, resolve_ip=True):
165165
# Attempt to resolve the hostname and get an IP address.
166166
self.keep_alive = keep_alive
167167
parsed_url = parse.urlparse(remote_server_addr)
168-
self._hostname = parsed_url.hostname
169168
addr = ""
170169
if parsed_url.hostname and resolve_ip:
171170
try:
@@ -415,8 +414,7 @@ def _request(self, method, url, body=None):
415414
headers = {"Connection": 'keep-alive', method: parsed_url.path,
416415
"User-Agent": "Python http auth",
417416
"Content-type": "application/json;charset=\"UTF-8\"",
418-
"Accept": "application/json",
419-
"Host": self._hostname}
417+
"Accept": "application/json"}
420418
if parsed_url.username:
421419
auth = base64.standard_b64encode('%s:%s' %
422420
(parsed_url.username, parsed_url.password)).replace('\n', '')
@@ -454,7 +452,6 @@ def _request(self, method, url, body=None):
454452

455453
request.add_header('Accept', 'application/json')
456454
request.add_header('Content-Type', 'application/json;charset=UTF-8')
457-
request.add_header('Host', self._hostname)
458455

459456
if password_manager:
460457
opener = url_request.build_opener(url_request.HTTPRedirectHandler(),

0 commit comments

Comments
 (0)