From: khamidou Date: Tue, 8 Dec 2009 20:12:28 +0000 (+0100) Subject: playing with repr X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d11e5d2182744d26fbad02883cd928a8e6d10a6e;p=tunnel.git playing with repr --- diff --git a/tunnel.py b/tunnel.py index ae07d5a..fbf81ab 100755 --- a/tunnel.py +++ b/tunnel.py @@ -24,17 +24,11 @@ class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): headers = {"Proxy-Connection" : "", - "User-Agent" : "Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11", - "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "Accept-Language": "fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3", - "Accept-Encoding": "gzip,deflate", - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Keep-Alive": "300", "Proxy-Connection": "keep-alive", - } - req = urllib2.Request(self.path, headers=headers) - print self.headers + + req = urllib2.Request(self.path, headers=repr(self.headers)) + try: data = urllib2.urlopen(req) self.send_response(200)