From 97d193faf12a18142d5e2f117f67db5df7f5eb65 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:41:29 -0700 Subject: [PATCH] Fix crowdsec widget with no bans / alerts --- src/widgets/crowdsec/component.jsx | 6 +++--- src/widgets/crowdsec/proxy.js | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/widgets/crowdsec/component.jsx b/src/widgets/crowdsec/component.jsx index 9565ee73f..2e98cee9f 100644 --- a/src/widgets/crowdsec/component.jsx +++ b/src/widgets/crowdsec/component.jsx @@ -16,7 +16,7 @@ export default function Component({ service }) { return ; } - if (!alerts || !bans) { + if (!alerts && !bans) { return ( @@ -27,8 +27,8 @@ export default function Component({ service }) { return ( - - + + ); } diff --git a/src/widgets/crowdsec/proxy.js b/src/widgets/crowdsec/proxy.js index a367e7165..e78fbc5ef 100644 --- a/src/widgets/crowdsec/proxy.js +++ b/src/widgets/crowdsec/proxy.js @@ -71,10 +71,6 @@ export default async function crowdsecProxyHandler(req, res) { logger.debug("Calling Crowdsec API endpoint: %s", endpoint); - if (endpoint.indexOf("decisions") === 0) { - delete params.headers.Authorization; - } - const [status, , data] = await httpProxy(url, params); if (status !== 200) {