Skip to content

Commit

Permalink
Case-insensitive parsing of server response
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartFinn committed Nov 30, 2024
1 parent 05a034b commit 99d7bb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ utils:github_latest_release() {
local repo="${1?}"

# Get tag name from URL redirection to avoid GitHub API limits
awk -F'[ /]' -v e=1 '/< location:/ {e=0; gsub(/\r/, "", $NF); print $NF;} END {exit(e);}' < <(
awk -F'[ /]' -v e=1 '/< [Ll]ocation:/ {e=0; gsub(/\r/, "", $NF); print $NF;} END {exit(e);}' < <(
LANG=C curl -A "Mozilla/5.0" --verbose \
"https://github.com/$repo/releases/latest" 2>&1
)
Expand Down Expand Up @@ -107,7 +107,7 @@ utils:gitea_latest_release() {
local gitea_host="${2:-gitea.com}"

# Get tag name from URL redirection to avoid TOKEN requires
awk -F'[ /]' -v e=1 '/< location:/ {e=0; gsub(/\r/, "", $NF); print $NF;} END {exit(e);}' < <(
awk -F'[ /]' -v e=1 '/< [Ll]ocation:/ {e=0; gsub(/\r/, "", $NF); print $NF;} END {exit(e);}' < <(
LANG=C curl -A "Mozilla/5.0" --verbose \
"https://$gitea_host/$repo/releases/latest" 2>&1
)
Expand Down

0 comments on commit 99d7bb6

Please sign in to comment.