Skip to content

Commit be33cbe

Browse files
committed
gh/get-etag.sh: sanitize ETAGs
XIEMA uses something like (for ARM mac): "cs-cz|6ea47896-cfc1-4c33-a2cc-5dc7ee38de39|15.05.2024 11:57:53|LiveSite" where the spaces and pipes may cause problems later if not properly sanitized. Doesn't seem to cause problems so far but perhaps still better to sanitize. Keep just chars from Portable Filename Character Set (alnums + <space>, <dash-minus>, <underscore>), other replace with _.
1 parent 64a3e9f commit be33cbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/scripts/get-etag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
ETAG=$(curl -LI "$1" | grep -i '^etag' | sed 's/.*"\(.*\)".*/\1/')
66
if [ "$ETAG" ]; then
7-
printf '%s\n' "$ETAG"
7+
printf '%s\n' "$ETAG" | sed 's/[^-._A-Za-z0-9]/_/g'
88
exit 0
99
fi
1010

0 commit comments

Comments
 (0)