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)
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)
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)
def __init__(self, *args, **kwargs): RouterBase.__init__(self, *args, **kwargs) self._is_logged_in = False
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)
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)