On our Acquia environment, a proxy is used, so the https detection is failing.
$base = 'http://fonts.googleapis.com/css?family=';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$base = 'https://fonts.googleapis.com/css?family=';
}
Acquia (and others behind proxies) uses $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'
We have manually overridden this detection for now, but it would be great if the module could check this as well.
Perhaps:
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$base = 'https://fonts.googleapis.com/css?family=';
}
Comments
Comment #2
volkswagenchickI found that "https://fonts.googleapis.com/css?family=" leads me to a Error (400): Missing font family page
Comment #3
hayzer commentedThat is the prefix for the fonts... the final result will be something more specific.
ex: href="https://fonts.googleapis.com/css?family=Noto+Sans:regular|Raleway:300|ABeeZee:regular|Roboto:300|Open+Sans:300&subset=latin,cyrillic"
Comment #4
btmash commentedPart of me wonders if we should just force https instead (regardless if the site uses ssl or not). Would there be any issues with that?
Going to test it out locally.
Comment #6
btmash commentedSince the ssl version is what google recommends, removed the check entirely. Committed to dev.
Comment #8
kyletaylored commentedThis needs to be rolled back into 7.x as well. Patch attached, including updated path for project (code.google.com/webfonts is no more), and in Font object.