bergum commited on
Commit
c1fd764
1 Parent(s): 025fe4a

Update proxy.py

Browse files
Files changed (1) hide show
  1. proxy.py +2 -0
proxy.py CHANGED
@@ -16,6 +16,8 @@ class ProxyRequestHandler(http.server.SimpleHTTPRequestHandler):
16
  headers = dict(self.headers)
17
  if 'Host' in headers:
18
  del headers['Host'] # Remove "Host" header to avoid "HTTP/1.1 400 Bad Request" error
 
 
19
  conn = http.client.HTTPConnection('localhost', PROXY_PORT)
20
  print(headers)
21
  conn.request('GET', url, headers=headers)
 
16
  headers = dict(self.headers)
17
  if 'Host' in headers:
18
  del headers['Host'] # Remove "Host" header to avoid "HTTP/1.1 400 Bad Request" error
19
+ if 'host' in headers:
20
+ del headers['host'] # Remove "Host" header to avoid "HTTP/1.1 400 Bad Request" error
21
  conn = http.client.HTTPConnection('localhost', PROXY_PORT)
22
  print(headers)
23
  conn.request('GET', url, headers=headers)