proxyAuth: Fix docker UA detection

This commit is contained in:
Girish Ramakrishnan
2021-02-09 13:44:34 -08:00
parent 30c3acaed9
commit 1d0ad3cb47
3 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -104,7 +104,8 @@ function isBrowser(req) {
const userAgent = req.get('user-agent');
if (!userAgent) return false;
return !userAgent.toLowerCase().includes('docker-client');
// https://github.com/docker/engine/blob/master/dockerversion/useragent.go#L18
return !userAgent.toLowerCase().includes('docker');
}
// called by nginx to authorize any protected route. this route must return only 2xx or 401/403 (http://nginx.org/en/docs/http/ngx_http_auth_request_module.html)