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

hayzer created an issue. See original summary.

volkswagenchick’s picture

I found that "https://fonts.googleapis.com/css?family=" leads me to a Error (400): Missing font family page

hayzer’s picture

That 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"

btmash’s picture

Part 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.

  • BTMash committed 4eaf909 on 8.x-3.x
    Issue #2901275 by hayzer, volkswagenchick, BTMash: https detection on...
btmash’s picture

Status: Active » Fixed

Since the ssl version is what google recommends, removed the check entirely. Committed to dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kyletaylored’s picture

Version: 8.x-3.1 » 7.x-2.x-dev
StatusFileSize
new2.05 KB

This 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.