Skip to content

Commit

Permalink
Use HTTPS when downloading fonts
Browse files Browse the repository at this point in the history
Google Fonts is accessible over HTTPS. This patch changes the download URLs from HTTP to HTTPS.
  • Loading branch information
joelpurra committed Apr 28, 2016
1 parent aefada8 commit 870064d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions google-font-download
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set -euo pipefail
css="font.css"
lang="latin"
format="all"
url="http://fonts.googleapis.com/css"
url="https://fonts.googleapis.com/css"

# Usage message
usage() {
Expand Down Expand Up @@ -333,9 +333,9 @@ for family in "${families[@]}"; do

# Download Google's CSS and throw some regex at it to find the font's URL
if [ "$uakey" != "svg" ]; then
pattern="http:\\/\\/[^\\)]+\\.$uakey"
pattern="https:\\/\\/[^\\)]+\\.$uakey"
else
pattern="http:\\/\\/[^\\)]+"
pattern="https:\\/\\/[^\\)]+"
fi
file=$(curl -sf -A "${useragent[$uakey]}" --get --data-urlencode "family=$family" --data-urlencode "subset=$lang" "$url" | grep -Eo "$pattern" | sort -u)
printf >>"$css" "\t\t/* from %s */\n" "$file"
Expand Down

0 comments on commit 870064d

Please sign in to comment.