Skip to content

Commit

Permalink
Only insert the Authorization header on the first instantiation of th…
Browse files Browse the repository at this point in the history
…e KOIOS_API_HEADERS.
  • Loading branch information
TrevorBenson authored Aug 16, 2024
1 parent 8b076ab commit 5e659f8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/cnode-helper-scripts/env
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 5e659f8

Please sign in to comment.