@@ -165,7 +165,6 @@ def __init__(self, remote_server_addr, keep_alive=False, resolve_ip=True):
165
165
# Attempt to resolve the hostname and get an IP address.
166
166
self .keep_alive = keep_alive
167
167
parsed_url = parse .urlparse (remote_server_addr )
168
- self ._hostname = parsed_url .hostname
169
168
addr = ""
170
169
if parsed_url .hostname and resolve_ip :
171
170
try :
@@ -415,8 +414,7 @@ def _request(self, method, url, body=None):
415
414
headers = {"Connection" : 'keep-alive' , method : parsed_url .path ,
416
415
"User-Agent" : "Python http auth" ,
417
416
"Content-type" : "application/json;charset=\" UTF-8\" " ,
418
- "Accept" : "application/json" ,
419
- "Host" : self ._hostname }
417
+ "Accept" : "application/json" }
420
418
if parsed_url .username :
421
419
auth = base64 .standard_b64encode ('%s:%s' %
422
420
(parsed_url .username , parsed_url .password )).replace ('\n ' , '' )
@@ -454,7 +452,6 @@ def _request(self, method, url, body=None):
454
452
455
453
request .add_header ('Accept' , 'application/json' )
456
454
request .add_header ('Content-Type' , 'application/json;charset=UTF-8' )
457
- request .add_header ('Host' , self ._hostname )
458
455
459
456
if password_manager :
460
457
opener = url_request .build_opener (url_request .HTTPRedirectHandler (),
0 commit comments