expo / google-fonts

Use any of the 1000+ fonts (and their variants) from fonts.google.com in your Expo app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloudfront urls are http instead of https which break snack

peterpme opened this issue · comments

I was digging into why my font wasn't showing up on Snack. I console logged the package and saw that the url was http instead of https. I grabbed the URL directly and added https and it worked

https://snack.expo.io/@peterpme/broken-inter-font-with-http
https://snack.expo.io/@peterpme/working-inter-font-with-https

Hmmm... I don't know why we would ever use an http URL. Do you see an easy place to transform it to https?

Hey, thanks for the quick response!

When I console.log:

import { useFonts, Inter_900Black } from '@expo-google-fonts/inter';
console.log(Inter_900Black)

The URL returned is a cloudfront url. I'm not sure its specific to google's because there's snackager in the url: http://d37p21p3n8r8ug.cloudfront.net/snackager-1%2F%40expo-google-fonts~inter%400.1.0-web/assets/_inter_900black.ttf

The urls here all have https:
https://github.com/expo/google-fonts/blob/master/packages/expo-google-fonts/index.js

That being said, in all the font-specific packages, I do see http: https://github.com/expo/google-fonts/search?q=http%3A%2F%2F

I imagine there's a script we can run to process those URLs when generating the individual package?

Awesome, thank you!

@IjzerenHein and I are going to test this PR which should fix this issue. Changing this has a big impact, so we prefer to fully test it on staging before rolling it out on production.