From 5e659f8b378cc1486795525266ad8083c641b8e3 Mon Sep 17 00:00:00 2001 From: illuminatus Date: Fri, 16 Aug 2024 10:02:18 -0700 Subject: [PATCH] Only insert the Authorization header on the first instantiation of the KOIOS_API_HEADERS. --- scripts/cnode-helper-scripts/env | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/cnode-helper-scripts/env b/scripts/cnode-helper-scripts/env index 66358cff9..8cad7e85d 100644 --- a/scripts/cnode-helper-scripts/env +++ b/scripts/cnode-helper-scripts/env @@ -955,8 +955,13 @@ set_default_vars() { [[ -z ${MITHRIL_HOME} ]] && MITHRIL_HOME="${CNODE_HOME}/mithril" [[ -z ${MITHRIL_SIGNER_ENABLED} ]] && MITHRIL_SIGNER_ENABLED="N" [[ -z ${STRICT_VERSION_CHECK} ]] && STRICT_VERSION_CHECK="Y" - [[ -z "${KOIOS_API_HEADERS[*]}" ]] && KOIOS_API_HEADERS=() - [[ -n "${KOIOS_API_TOKEN}" ]] && KOIOS_API_HEADERS+=(-H "'Authorization: Bearer ${KOIOS_API_TOKEN}'") + if [[ -z "${KOIOS_API_HEADERS[*]}" ]] ; then + if [[ -n "${KOIOS_API_TOKEN}" ]] ; then + KOIOS_API_HEADERS=(-H "'Authorization: Bearer ${KOIOS_API_TOKEN}'") + else + KOIOS_API_HEADERS=() + fi + fi FG_BLACK='\e[30m' FG_RED='\e[31m' FG_GREEN='\e[32m'