From 2cf4ca07f44031dead6469fd5bc91ff7e7f57841 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 4 Dec 2023 17:14:55 +0100 Subject: [PATCH] fix: Set request header --- src/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/install.sh b/src/install.sh index 820d206..07164af 100644 --- a/src/install.sh +++ b/src/install.sh @@ -34,7 +34,7 @@ if [ -z "$DL" ]; then info "Install: Selecting download mirror..." # Detect country - { JSON=$(curl -sfk https://ipinfo.io/json); rc=$?; } || : + { JSON=$(curl -H "Accept: application/json" -sfk https://ipinfo.io/json); rc=$?; } || : if (( rc == 0 )); then { COUNTRY=$(echo "$JSON" | jq -r '.country' 2> /dev/null); rc=$?; } || : @@ -42,7 +42,7 @@ if [ -z "$DL" ]; then fi if [[ -z "$COUNTRY" ]]; then - { JSON=$(curl -sfk https://api.ipapi.is); rc=$?; } || : + { JSON=$(curl -H "Accept: application/json" -sfk https://api.ipapi.is); rc=$?; } || : if (( rc == 0 )); then { COUNTRY=$(echo "$JSON" | jq -r '.location.country_code' 2> /dev/null); rc=$?; } || : (( rc != 0 )) || [[ "$COUNTRY" == "null" ]] && COUNTRY=""