Permalink
Browse files

Tweak how we mark ourselves in UA, so that fonts.g.c recognizes us pr…

…oxying IE11 as IE11.

(Will also need a similar change to nginx native fetcher)
Fixes apache/incubator-pagespeed-ngx#1080
  • Loading branch information...
morlovich committed Jan 26, 2016
1 parent 9460f44 commit f3639e84c0196a5f5151ff5e54ad57285db09b37
Showing with 15 additions and 2 deletions.
  1. +13 −0 pagespeed/automatic/system_tests/inliners.sh
  2. +2 −2 pagespeed/system/serf_url_async_fetcher.cc
@@ -35,6 +35,19 @@ EOF
OUT=$($WGET_DUMP $URL)
check_from "$OUT" fgrep -qi ".eot"
check_not_from "$OUT" fgrep -qi ".ttf"

# And now IE11.
export WGETRC=$TESTTMP/wgetrc-ie11
cat > $WGETRC <<EOF
user_agent = Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
EOF
# This should get a woff font. (We used to confuse things so that it would
# produce ttf).
fetch_until $URL 'grep -c @font-face' 1
OUT=$($WGET_DUMP $URL)
check_from "$OUT" fgrep -qi ".woff"
check_not_from "$OUT" fgrep -qi ".ttf"

export WGETRC=$WGETRC_OLD
fi

@@ -595,8 +595,8 @@ void SerfFetch::FixUserAgent() {
user_agent += "Serf/" SERF_VERSION_STRING;
}
GoogleString version = StrCat(
" ", kModPagespeedSubrequestUserAgent,
"/" MOD_PAGESPEED_VERSION_STRING "-" LASTCHANGE_STRING);
" (", kModPagespeedSubrequestUserAgent,
"/" MOD_PAGESPEED_VERSION_STRING "-" LASTCHANGE_STRING ")");
if (!StringPiece(user_agent).ends_with(version)) {
user_agent += version;
}

0 comments on commit f3639e8

Please sign in to comment.