From 6a177b74e0edd9890a6e221cf05dd80d4eeaf5c2 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Thu, 20 Aug 2026 12:49:23 +0800 Subject: [PATCH] fix(release): URL-encode release asset names The release upload passed basename() raw in the name= query param, so a '+' in the signed xpi filename (ismis-helper-1.4.0-an+fx.xpi) was URL-decoded to a space. Encode with urllib.parse.quote before the request. --- .gitea/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index a65de39..78bad45 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -76,8 +76,12 @@ jobs: # Attach zips and the signed xpi (if present) as release assets for f in dist/*.zip dist/*.xpi; do [ -f "$f" ] || continue + NAME="$(basename "$f")" + # URL-encode the asset name so '+' (in 'ismis-helper-1.4.0-an+fx.xpi') + # survives the query string instead of being decoded to a space. + ENC=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=''))" "$NAME") curl -sS -X POST \ -H "Authorization: token ${GITHUB_TOKEN}" \ -F "attachment=@${f}" \ - "${API}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$(basename "${f}")" + "${API}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${ENC}" done \ No newline at end of file -- 2.54.0