瀏覽代碼

Remove use of RawGit CDN (https://twitter.com/rawgit/status/1049360165030567937)

Tianon Gravi 7 年之前
父節點
當前提交
1f9dc5d152
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      update.sh

+ 4 - 3
update.sh

@@ -78,11 +78,12 @@ for image in "${images[@]}"; do
 		if [ "$logoFile" ]; then
 			logoCommit="$(git log -1 --format='format:%H' -- "$logoFile" 2>/dev/null || true)"
 			[ "$logoCommit" ] || logoCommit='master'
+			logoUrl="https://raw.githubusercontent.com/docker-library/docs/$logoCommit/$logoFile"
 			if [ "${logoFile##*.}" = 'svg' ]; then
-				logo="![logo](https://cdn.rawgit.com/docker-library/docs/$logoCommit/$logoFile)"
-			else
-				logo="![logo](https://raw.githubusercontent.com/docker-library/docs/$logoCommit/$logoFile)"
+				# https://stackoverflow.com/a/16462143/433558
+				logoUrl+='?sanitize=true'
 			fi
+			logo="![logo]($logoUrl)"
 		fi
 
 		stack=