Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTPS when downloading fonts #7

Merged
merged 1 commit into from
Apr 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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