Set Application controller default URL options to ensure all url_for calls are consistent
Closes #1249
This commit is contained in:
parent
6199da0cb4
commit
8173ef976f
2 changed files with 13 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
Please view this file on the master branch, on stable branches it's out of date.
|
||||
|
||||
v 7.10.0 (unreleased)
|
||||
- Set Application controller default URL options to ensure all url_for calls are consistent (Stan Hu)
|
||||
- Allow HTML tags in Markdown input
|
||||
- Include missing events and fix save functionality in admin service template settings form (Stan Hu)
|
||||
- Fix "Import projects from" button to show the correct instructions (Stan Hu)
|
||||
|
|
|
@ -178,6 +178,18 @@ class ApplicationController < ActionController::Base
|
|||
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
|
||||
end
|
||||
|
||||
def default_url_options
|
||||
if !Rails.env.test?
|
||||
port = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port?
|
||||
{ host: Gitlab.config.gitlab.host,
|
||||
protocol: Gitlab.config.gitlab.protocol,
|
||||
port: port,
|
||||
script_name: Gitlab.config.gitlab.relative_url_root }
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def default_headers
|
||||
headers['X-Frame-Options'] = 'DENY'
|
||||
headers['X-XSS-Protection'] = '1; mode=block'
|
||||
|
|
Loading…
Reference in a new issue