Bug 1077312 - Clean up Accept headers on @font-face HTTP requests. r=mcmanus

This commit is contained in:
Jonathan Kew 2014-10-09 08:42:02 +01:00
Родитель f1655f6098
Коммит dcc3e798ae
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -439,8 +439,15 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
#endif
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel)
if (httpChannel) {
httpChannel->SetReferrer(aFontFaceSrc->mReferrer);
nsAutoCString accept("application/font-woff;q=0.9,*/*;q=0.8");
if (Preferences::GetBool(GFX_PREF_WOFF2_ENABLED)) {
accept.Insert(NS_LITERAL_CSTRING("application/font-woff2;q=1.0,"), 0);
}
httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
accept, false);
}
nsCOMPtr<nsISupportsPriority> priorityChannel(do_QueryInterface(channel));
if (priorityChannel) {
priorityChannel->AdjustPriority(nsISupportsPriority::PRIORITY_HIGH);