summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.py b/main.py
index 22e6fa42..fda81038 100755
--- a/main.py
+++ b/main.py
@@ -276,10 +276,17 @@ class _UserAgentHandler(urllib2.BaseHandler):
276class _BasicAuthHandler(urllib2.HTTPBasicAuthHandler): 276class _BasicAuthHandler(urllib2.HTTPBasicAuthHandler):
277 def http_error_auth_reqed(self, authreq, host, req, headers): 277 def http_error_auth_reqed(self, authreq, host, req, headers):
278 try: 278 try:
279 old_add_header = req.add_header
280 def _add_header(name, val):
281 val = val.replace('\n', '')
282 old_add_header(name, val)
283 req.add_header = _add_header
279 return urllib2.AbstractBasicAuthHandler.http_error_auth_reqed( 284 return urllib2.AbstractBasicAuthHandler.http_error_auth_reqed(
280 self, authreq, host, req, headers) 285 self, authreq, host, req, headers)
281 except: 286 except:
282 self.reset_retry_count() 287 reset = getattr(self, 'reset_retry_count', None)
288 if reset is not None:
289 reset()
283 raise 290 raise
284 291
285def init_http(): 292def init_http():