Skip to content

Commit

Permalink
Bug 1080174 - Do not send Accept-Encoding:gzip,deflate when requestin…
Browse files Browse the repository at this point in the history
…g WOFF or WOFF2 webfonts. r=mcmanus
  • Loading branch information
jfkthame committed Oct 9, 2014
1 parent dcc3e79 commit a400b87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions layout/style/FontFaceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,13 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
}
httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
accept, false);
// For WOFF and WOFF2, we should tell servers/proxies/etc NOT to try
// and apply additional compression at the content-encoding layer
if (aFontFaceSrc->mFormatFlags & (gfxUserFontSet::FLAG_FORMAT_WOFF |
gfxUserFontSet::FLAG_FORMAT_WOFF2)) {
httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Encoding"),
NS_LITERAL_CSTRING("identity"), false);
}
}
nsCOMPtr<nsISupportsPriority> priorityChannel(do_QueryInterface(channel));
if (priorityChannel) {
Expand Down

0 comments on commit a400b87

Please sign in to comment.