BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8140c682
Commit
8140c682
authored
Apr 28, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-issue-2269' into 'master'
Remove duplicate settings for default_url_options Closes #2269 See merge request !1797
parents
f0227d76
e3d2304d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
52 deletions
+10
-52
application_controller.rb
app/controllers/application_controller.rb
+0
-12
notify.rb
app/mailers/notify.rb
+1
-6
gitlab_issue_tracker_service.rb
app/models/project_services/gitlab_issue_tracker_service.rb
+0
-5
8_default_url_options.rb
config/initializers/8_default_url_options.rb
+9
-11
users_spec.rb
spec/features/users_spec.rb
+0
-7
reference_filter_spec_helper.rb
spec/support/reference_filter_spec_helper.rb
+0
-11
No files found.
app/controllers/application_controller.rb
View file @
8140c682
...
...
@@ -182,18 +182,6 @@ 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'
...
...
app/mailers/notify.rb
View file @
8140c682
...
...
@@ -16,11 +16,6 @@ class Notify < ActionMailer::Base
attr_accessor
:current_user
helper_method
:current_user
,
:can?
default_url_options
[
:host
]
=
Gitlab
.
config
.
gitlab
.
host
default_url_options
[
:protocol
]
=
Gitlab
.
config
.
gitlab
.
protocol
default_url_options
[
:port
]
=
Gitlab
.
config
.
gitlab
.
port
unless
Gitlab
.
config
.
gitlab_on_standard_port?
default_url_options
[
:script_name
]
=
Gitlab
.
config
.
gitlab
.
relative_url_root
default
from:
Proc
.
new
{
default_sender_address
.
format
}
default
reply_to:
Gitlab
.
config
.
gitlab
.
email_reply_to
...
...
@@ -69,7 +64,7 @@ class Notify < ActionMailer::Base
# Only the displayed name changes; the actual email address is always the same.
def
sender
(
sender_id
,
send_from_user_email
=
false
)
return
unless
sender
=
User
.
find
(
sender_id
)
address
=
default_sender_address
address
.
display_name
=
sender
.
name
...
...
app/models/project_services/gitlab_issue_tracker_service.rb
View file @
8140c682
...
...
@@ -21,11 +21,6 @@
class
GitlabIssueTrackerService
<
IssueTrackerService
include
Rails
.
application
.
routes
.
url_helpers
default_url_options
[
:host
]
=
Gitlab
.
config
.
gitlab
.
host
default_url_options
[
:protocol
]
=
Gitlab
.
config
.
gitlab
.
protocol
default_url_options
[
:port
]
=
Gitlab
.
config
.
gitlab
.
port
unless
Gitlab
.
config
.
gitlab_on_standard_port?
default_url_options
[
:script_name
]
=
Gitlab
.
config
.
gitlab
.
relative_url_root
prop_accessor
:title
,
:description
,
:project_url
,
:issues_url
,
:new_issue_url
def
default?
...
...
config/initializers/8_default_url_options.rb
View file @
8140c682
unless
Rails
.
env
.
test?
default_url_options
=
{
host:
Gitlab
.
config
.
gitlab
.
host
,
protocol:
Gitlab
.
config
.
gitlab
.
protocol
,
script_name:
Gitlab
.
config
.
gitlab
.
relative_url_root
}
default_url_options
=
{
host:
Gitlab
.
config
.
gitlab
.
host
,
protocol:
Gitlab
.
config
.
gitlab
.
protocol
,
script_name:
Gitlab
.
config
.
gitlab
.
relative_url_root
}
unless
Gitlab
.
config
.
gitlab_on_standard_port?
default_url_options
[
:port
]
=
Gitlab
.
config
.
gitlab
.
port
end
Rails
.
application
.
routes
.
default_url_options
=
default_url_options
unless
Gitlab
.
config
.
gitlab_on_standard_port?
default_url_options
[
:port
]
=
Gitlab
.
config
.
gitlab
.
port
end
Rails
.
application
.
routes
.
default_url_options
=
default_url_options
spec/features/users_spec.rb
View file @
8140c682
require
'spec_helper'
feature
'Users'
do
around
do
|
ex
|
old_url_options
=
Rails
.
application
.
routes
.
default_url_options
Rails
.
application
.
routes
.
default_url_options
=
{
host:
'example.foo'
}
ex
.
run
Rails
.
application
.
routes
.
default_url_options
=
old_url_options
end
scenario
'GET /users/sign_in creates a new user account'
do
visit
new_user_session_path
fill_in
'user_name'
,
with:
'Name Surname'
...
...
spec/support/reference_filter_spec_helper.rb
View file @
8140c682
...
...
@@ -4,17 +4,6 @@
module
ReferenceFilterSpecHelper
extend
ActiveSupport
::
Concern
included
do
before
{
set_default_url_options
}
end
# Allow *_url helpers to work
def
set_default_url_options
Rails
.
application
.
routes
.
default_url_options
=
{
host:
'example.foo'
}
end
# Shortcut to Rails' auto-generated routes helpers, to avoid including the
# module
def
urls
...
...
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