Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f83f1db4
Commit
f83f1db4
authored
Jun 29, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read asset host from ActionController::Base instead of application config
parent
ee2a9e0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
changelogs/unreleased/dm-favicon-asset-host.yml
changelogs/unreleased/dm-favicon-asset-host.yml
+6
-0
lib/gitlab/favicon.rb
lib/gitlab/favicon.rb
+2
-1
spec/lib/gitlab/favicon_spec.rb
spec/lib/gitlab/favicon_spec.rb
+1
-1
No files found.
changelogs/unreleased/dm-favicon-asset-host.yml
0 → 100644
View file @
f83f1db4
---
title
:
Always serve favicon from main GitLab domain so that CI badge can be drawn
over it
merge_request
:
author
:
type
:
fixed
lib/gitlab/favicon.rb
View file @
f83f1db4
...
@@ -38,7 +38,8 @@ module Gitlab
...
@@ -38,7 +38,8 @@ module Gitlab
# we only want to create full urls when there's a different asset_host
# we only want to create full urls when there's a different asset_host
# configured.
# configured.
def
host
def
host
if
Gitlab
::
Application
.
config
.
asset_host
.
nil?
||
Gitlab
::
Application
.
config
.
asset_host
==
Gitlab
.
config
.
gitlab
.
base_url
asset_host
=
ActionController
::
Base
.
asset_host
if
asset_host
.
nil?
||
asset_host
==
Gitlab
.
config
.
gitlab
.
base_url
nil
nil
else
else
Gitlab
.
config
.
gitlab
.
base_url
Gitlab
.
config
.
gitlab
.
base_url
...
...
spec/lib/gitlab/favicon_spec.rb
View file @
f83f1db4
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Favicon, :request_store do
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Favicon, :request_store do
end
end
it
'returns a full url when the asset host is configured'
do
it
'returns a full url when the asset host is configured'
do
allow
(
Gitlab
::
Application
.
config
).
to
receive
(
:asset_host
).
and_return
(
'http://assets.local'
)
allow
(
ActionController
::
Base
).
to
receive
(
:asset_host
).
and_return
(
'http://assets.local'
)
expect
(
described_class
.
main
).
to
match
%r{^http://localhost/assets/favicon-(?:
\h
+).png$}
expect
(
described_class
.
main
).
to
match
%r{^http://localhost/assets/favicon-(?:
\h
+).png$}
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment