bergum commited on
Commit
eebe15e
1 Parent(s): 901fe93

Update proxy.py

Browse files
Files changed (1) hide show
  1. proxy.py +2 -2
proxy.py CHANGED
@@ -14,8 +14,8 @@ class ProxyRequestHandler(http.server.SimpleHTTPRequestHandler):
14
  else:
15
  url = 'http://localhost:{}{}'.format(PROXY_PORT, self.path)
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
  conn.request('GET', url, headers=headers)
21
  response = conn.getresponse()
 
14
  else:
15
  url = 'http://localhost:{}{}'.format(PROXY_PORT, self.path)
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
  conn.request('GET', url, headers=headers)
21
  response = conn.getresponse()