示例#1
0
 def _perform_http_request(self, *args, **kwargs):
     # Without the Accept-Encoding header the web-interface of the
     # WR941N router (and potentially some other models) crashes.
     # A bug report was submitted to TpLink, but still no progress.
     # Even if they fix it, thousands of routers out there would still
     # run the old firmware and break.
     auth = base64.b64encode('%s:%s' % (self.username, self.password))
     kwargs['headers'] = [
         ('Accept-Encoding', 'gzip,deflate'),
         ('Authorization', 'Basic %s' % auth),
     ]
     return RouterBase._perform_http_request(self, *args, **kwargs)
示例#2
0
文件: base.py 项目: ikresoft/roscraco
 def _perform_http_request(self, *args, **kwargs):
     # Without the Accept-Encoding header the web-interface of the
     # WR941N router (and potentially some other models) crashes.
     # A bug report was submitted to TpLink, but still no progress.
     # Even if they fix it, thousands of routers out there would still
     # run the old firmware and break.
     kwargs['headers'] = [
         ('Accept-Encoding', 'gzip,deflate'),
         ('Referer', 'http://%s/' % self.host),
         ('Authorization', 'Basic %s' % self._prepare_base64_auth_string()),
     ]
     return RouterBase._perform_http_request(self, *args, **kwargs)
示例#3
0
 def _perform_http_request(self, *args, **kwargs):
     auth = base64.b64encode('%s:%s' % (self.username, self.password))
     kwargs['headers'] = [('Authorization', 'Basic %s' % auth)]
     return RouterBase._perform_http_request(self, *args, **kwargs)
示例#4
0
 def __init__(self, *args, **kwargs):
     RouterBase.__init__(self, *args, **kwargs)
     self._is_logged_in = False
示例#5
0
 def _perform_http_request(self, *args, **kwargs):
     kwargs['headers'] = [('Authorization', 'Basic %s' % self._prepare_base64_auth_string())]
     return RouterBase._perform_http_request(self, *args, **kwargs)
示例#6
0
 def __init__(self, *args, **kwargs):
     RouterBase.__init__(self, *args, **kwargs)
     self._is_logged_in = False
示例#7
0
文件: w268r.py 项目: cyroxx/roscraco
 def _perform_http_request(self, *args, **kwargs):
     auth = base64.b64encode('%s:%s' % (self.username, self.password))
     kwargs['headers'] = [
         ('Authorization', 'Basic %s' % auth),
     ]
     return RouterBase._perform_http_request(self, *args, **kwargs)