summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/favicon.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/favicon.rb b/lib/gitlab/favicon.rb
index 17e737ac913..e7fe0bff5b8 100644
--- a/lib/gitlab/favicon.rb
+++ b/lib/gitlab/favicon.rb
@@ -2,7 +2,7 @@ module Gitlab
class Favicon
class << self
def default
- return appearance_favicon.default.url if appearance_favicon.exists?
+ return custom_favicon_url(appearance_favicon.default.url) if appearance_favicon.exists?
return 'favicon-yellow.ico' if Gitlab::Utils.to_boolean(ENV['CANARY'])
return 'favicon-blue.ico' if Rails.env.development?
@@ -11,7 +11,7 @@ module Gitlab
def status(status_name)
if appearance_favicon.exists?
- appearance_favicon.public_send("status_#{status_name}").url
+ custom_favicon_url(appearance_favicon.public_send("status_#{status_name}").url) # rubocop:disable GitlabSecurity/PublicSend
else
dir = 'ci_favicons'
dir = File.join(dir, 'dev') if Rails.env.development?
@@ -30,6 +30,13 @@ module Gitlab
def appearance_favicon
appearance.favicon
end
+
+ # Without the '?' at the end of the favicon url the custom favicon (i.e.
+ # the favicons that are served through `UploadController`) are not shown
+ # in the browser.
+ def custom_favicon_url(url)
+ "#{url}?"
+ end
end
end
end