summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-06-18 11:31:37 +0200
committerDouwe Maan <douwe@selenight.nl>2018-06-18 12:27:00 +0200
commit2a402a3e503b3c564b4e9dcbf9d7ede1d2291937 (patch)
tree90d763eff4ab2f4cb05255d043e38fc7c96c2a1b
parent99fdbe4c230205510e1d7061e68bb1a003913d4b (diff)
downloadgitlab-ce-dm-favicon-redirect.tar.gz
Redirect favicon.(png|ico) to actual favicon asset or uploaddm-favicon-redirect
-rw-r--r--config/routes.rb6
-rw-r--r--doc/user/reserved_names.md1
-rw-r--r--lib/gitlab/path_regex.rb1
-rw-r--r--public/favicon.pngbin1611 -> 0 bytes
4 files changed, 8 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 52726f94753..e0a9139b1b4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -11,6 +11,12 @@ Rails.application.routes.draw do
post :toggle_award_emoji, on: :member
end
+ favicon_redirect = redirect do |_params, _request|
+ ActionController::Base.helpers.asset_url(Gitlab::Favicon.main)
+ end
+ get 'favicon.png', to: favicon_redirect
+ get 'favicon.ico', to: favicon_redirect
+
draw :sherlock
draw :development
draw :ci
diff --git a/doc/user/reserved_names.md b/doc/user/reserved_names.md
index 6c1378560ef..918daee5d9f 100644
--- a/doc/user/reserved_names.md
+++ b/doc/user/reserved_names.md
@@ -58,6 +58,7 @@ Currently the following names are reserved as top level groups:
- dashboard
- deploy.html
- explore
+- favicon.ico
- favicon.png
- groups
- header_logo_dark.png
diff --git a/lib/gitlab/path_regex.rb b/lib/gitlab/path_regex.rb
index e5191f5c7f9..61653044433 100644
--- a/lib/gitlab/path_regex.rb
+++ b/lib/gitlab/path_regex.rb
@@ -30,6 +30,7 @@ module Gitlab
dashboard
deploy.html
explore
+ favicon.ico
favicon.png
files
groups
diff --git a/public/favicon.png b/public/favicon.png
deleted file mode 100644
index 845e0ec34a5..00000000000
--- a/public/favicon.png
+++ /dev/null
Binary files differ