Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit f3639e8

Browse files
committed
Tweak how we mark ourselves in UA, so that fonts.g.c recognizes us proxying IE11 as IE11.
(Will also need a similar change to nginx native fetcher) Fixes apache/incubator-pagespeed-ngx#1080
1 parent 9460f44 commit f3639e8

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

pagespeed/automatic/system_tests/inliners.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ EOF
3535
OUT=$($WGET_DUMP $URL)
3636
check_from "$OUT" fgrep -qi ".eot"
3737
check_not_from "$OUT" fgrep -qi ".ttf"
38+
39+
# And now IE11.
40+
export WGETRC=$TESTTMP/wgetrc-ie11
41+
cat > $WGETRC <<EOF
42+
user_agent = Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
43+
EOF
44+
# This should get a woff font. (We used to confuse things so that it would
45+
# produce ttf).
46+
fetch_until $URL 'grep -c @font-face' 1
47+
OUT=$($WGET_DUMP $URL)
48+
check_from "$OUT" fgrep -qi ".woff"
49+
check_not_from "$OUT" fgrep -qi ".ttf"
50+
3851
export WGETRC=$WGETRC_OLD
3952
fi
4053

pagespeed/system/serf_url_async_fetcher.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ void SerfFetch::FixUserAgent() {
595595
user_agent += "Serf/" SERF_VERSION_STRING;
596596
}
597597
GoogleString version = StrCat(
598-
" ", kModPagespeedSubrequestUserAgent,
599-
"/" MOD_PAGESPEED_VERSION_STRING "-" LASTCHANGE_STRING);
598+
" (", kModPagespeedSubrequestUserAgent,
599+
"/" MOD_PAGESPEED_VERSION_STRING "-" LASTCHANGE_STRING ")");
600600
if (!StringPiece(user_agent).ends_with(version)) {
601601
user_agent += version;
602602
}

0 commit comments

Comments
 (0)