prom-client: fix warning

This commit is contained in:
undefined committed 2022-10-05 20:22:16 +08:00
1 parent c394378dba
commit d79643024a
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ class MetricsHandler extends Handler {
return;
}
const [name, password] = SystemModel.getMany(['prom-client.name', 'prom-client.password']);
const key = this.request.headers.authorization?.split('Basic ')?.[1];
const key = this.request.headers.authorization.split('Basic ')?.[1];
if (!key || key !== Buffer.from(`${name}:${password}`).toString('base64')) {
this.response.status = 403;
this.response.body = {};