From d5c8060a65f9ecd92fec34db16dd3b575c118394 Mon Sep 17 00:00:00 2001 From: ACHMAD ALIF NASRULLOH <106044706+achmadalifn4@users.noreply.github.com> Date: Sun, 5 Apr 2026 11:58:15 +0700 Subject: [PATCH] Update deploy/byteplus_alb.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- deploy/byteplus_alb.sh | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/deploy/byteplus_alb.sh b/deploy/byteplus_alb.sh index f87be9a0..ab6decc5 100644 --- a/deploy/byteplus_alb.sh +++ b/deploy/byteplus_alb.sh @@ -390,32 +390,9 @@ ${_cr_hash}" } # ══════════════════════════════════════════════════════════════════════════════ -# URL encode (RFC 3986) — awk-based for performance +# URL encode (RFC 3986) # ══════════════════════════════════════════════════════════════════════════════ _byteplus_urlencode() { - printf '%s' "$1" | awk 'BEGIN { - for (i = 0; i <= 255; i++) { - c = sprintf("%c", i) - if (c ~ /[a-zA-Z0-9.~_\-]/) - safe[i] = c - else - safe[i] = sprintf("%%%02X", i) - } - } - { - n = length($0) - for (i = 1; i <= n; i++) { - c = substr($0, i, 1) - printf "%s", safe[ord(c)] - } - # Print newline as %0A (except trailing, which command substitution strips) - if (NR > 0) printf "%%0A" - } - function ord(c, i2) { - for (i2 = 0; i2 <= 255; i2++) - if (sprintf("%c", i2) == c) return i2 - return 0 - } - END { }' | sed 's/%0A$//' + _url_encode "$1" }