Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Tweak how we mark ourselves in UA, so that fonts.g.c recognizes us pr…
Browse files Browse the repository at this point in the history
…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 f3639e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions pagespeed/automatic/system_tests/inliners.sh
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pagespeed/system/serf_url_async_fetcher.cc
Expand Up @@ -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;
}
Expand Down

0 comments on commit f3639e8

Please sign in to comment.