diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7e3adef2..f0d19b5a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -21,7 +21,7 @@ volumes: services: nginx: - image: nginx:1.14.2 + image: nginx:1.16.0-alpine container_name: mainflux-nginx restart: on-failure volumes: diff --git a/docker/ssl/authorization.js b/docker/ssl/authorization.js index 7eea0e15..7e8968c2 100644 --- a/docker/ssl/authorization.js +++ b/docker/ssl/authorization.js @@ -133,12 +133,12 @@ function setKey(r) { } var auth = r.headersIn['Authorization']; - if (auth.length && auth != clientKey) { + if (auth && auth.length && auth != clientKey) { r.error('Authorization header does not match certificate'); return ''; } - if (r.uri.startsWith('/ws') && !auth.length) { + if (r.uri.startsWith('/ws') && (!auth || !auth.length)) { var a; for (a in r.args) { if (a == 'authorization' && r.args[a] === clientKey) {