Skip to content

Commit

Permalink
Merge pull request #7 from joelpurra/use-https
Browse files Browse the repository at this point in the history
Use HTTPS when downloading fonts
  • Loading branch information
neverpanic committed Apr 28, 2016
2 parents aefada8 + 870064d commit 667a9ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions google-font-download
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 667a9ff

Please sign in to comment.