Download:
child 283:ce693988c419
parent 281:97d2ffd174e7
282:72b0672a98f7
Anton Shestakov <av6@dwimlabs.net>, Tue, 15 Aug 2017 22:16:25 +0800
updatesri: backslash is not an escape character for urls

1 файлов изменено, 2 вставок(+), 2 удалений(-) [+]
contrib/updatesri.sh file | annotate | diff | comparison | revisions
--- a/contrib/updatesri.sh Mon Jan 02 01:46:02 2017 +0800
+++ b/contrib/updatesri.sh Tue Aug 15 22:16:25 2017 +0800
@@ -2,12 +2,12 @@
set -euo pipefail
-( egrep -oh 'https://[^"]+\.js' "$@" || true ) | sort -u | while read url; do
+( egrep -oh 'https://[^"]+\.js' "$@" || true ) | sort -u | while read -r url; do
hash=$(curl -fsS "$url" | openssl dgst -sha384 -binary | openssl base64 -A)
sed -i "\|$url| c\\ <script src=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\"></script>" "$@"
done
-( egrep -oh 'https://[^"]+\.css' "$@" || true ) | sort -u | while read url; do
+( egrep -oh 'https://[^"]+\.css' "$@" || true ) | sort -u | while read -r url; do
hash=$(curl -fsS "$url" | openssl dgst -sha384 -binary | openssl base64 -A)
sed -i "\|$url| c\\ <link rel=\"stylesheet\" href=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\">" "$@"
done