diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-01-24 18:01:38 +0100 |
---|---|---|
committer | dklawren <dklawren@users.noreply.github.com> | 2018-01-24 18:01:38 +0100 |
commit | e6e4604a787fe24b150acf39c0060db083e550fa (patch) | |
tree | 270cec7e5d108ed6ddd1b45418090ae3618681b3 /Bugzilla | |
parent | 98def3926862c19b5b6ee30bba5bb0ad6bffd0db (diff) | |
download | bugzilla-e6e4604a787fe24b150acf39c0060db083e550fa.tar.gz bugzilla-e6e4604a787fe24b150acf39c0060db083e550fa.tar.xz |
Bug 1432812 - Send preload headers only for web-browser requests
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/CGI.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index f8a4bdbac..40262187b 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -513,15 +513,17 @@ sub header { ); $self->{_header_done} = 1; - my @fonts = ( - "skins/standard/fonts/FiraMono-Regular.woff2?v=3.202", - "skins/standard/fonts/FiraSans-Bold.woff2?v=4.203", - "skins/standard/fonts/FiraSans-Italic.woff2?v=4.203", - "skins/standard/fonts/FiraSans-Regular.woff2?v=4.203", - "skins/standard/fonts/FiraSans-SemiBold.woff2?v=4.203", - "skins/standard/fonts/MaterialIcons-Regular.woff2", - ); - $headers{'-link'} = join(", ", map { sprintf('</static/v%s/%s>; rel="preload"; as="font"', Bugzilla->VERSION, $_) } @fonts); + if (Bugzilla->usage_mode == USAGE_MODE_BROWSER) { + my @fonts = ( + "skins/standard/fonts/FiraMono-Regular.woff2?v=3.202", + "skins/standard/fonts/FiraSans-Bold.woff2?v=4.203", + "skins/standard/fonts/FiraSans-Italic.woff2?v=4.203", + "skins/standard/fonts/FiraSans-Regular.woff2?v=4.203", + "skins/standard/fonts/FiraSans-SemiBold.woff2?v=4.203", + "skins/standard/fonts/MaterialIcons-Regular.woff2", + ); + $headers{'-link'} = join(", ", map { sprintf('</static/v%s/%s>; rel="preload"; as="font"', Bugzilla->VERSION, $_) } @fonts); + } return $self->SUPER::header(%headers) || ""; } |