From: Calin Crisan Date: Sat, 31 Oct 2015 18:55:40 +0000 (+0200) Subject: fixed digest stream authentication X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d69111ec79db45438cae60ed9a15b1930aa3d5dd;p=motioneye-debian fixed digest stream authentication --- diff --git a/motioneye/mjpgclient.py b/motioneye/mjpgclient.py index 949e599..db85629 100644 --- a/motioneye/mjpgclient.py +++ b/motioneye/mjpgclient.py @@ -113,12 +113,7 @@ class MjpgClient(IOStream): logging.debug('mjpg client for camera %(camera_id)s connected on port %(port)s' % { 'port': self._port, 'camera_id': self._camera_id}) - if self._username: - auth_header = utils.build_basic_header(self._username, self._password) - self.write('GET / HTTP/1.0\r\n\r\nAuthorization: %s\r\n\r\n' % auth_header) - - else: - self.write('GET / HTTP/1.0\r\n\r\n') + self.write('GET / HTTP/1.0\r\n\r\n') self._seek_http() diff --git a/motioneye/motionctl.py b/motioneye/motionctl.py index 39265ca..db11109 100644 --- a/motioneye/motionctl.py +++ b/motioneye/motionctl.py @@ -218,7 +218,7 @@ def get_motion_detection(camera_id, callback): def on_response(response): if response.error: - return callback(error=utils.pretty_http_error()) + return callback(error=utils.pretty_http_error(response)) enabled = bool(response.body.lower().count('active')) diff --git a/motioneye/utils.py b/motioneye/utils.py index 2b89225..27ae864 100644 --- a/motioneye/utils.py +++ b/motioneye/utils.py @@ -665,7 +665,7 @@ def build_digest_header(method, url, username, password, state): last_nonce = nonce - base = 'username="%s", realm="%s", nonce="%s", path="%s", ' \ + base = 'username="%s", realm="%s", nonce="%s", uri="%s", ' \ 'response="%s"' % (username, realm, nonce, path, respdig) if opaque: base += ', opaque="%s"' % opaque