Commit 51f174b9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fix port issue

parent 00ef16a6
...@@ -4,7 +4,7 @@ class Notify < ActionMailer::Base ...@@ -4,7 +4,7 @@ class Notify < ActionMailer::Base
default_url_options[:host] = Gitlab.config.web_host default_url_options[:host] = Gitlab.config.web_host
default_url_options[:protocol] = Gitlab.config.web_protocol default_url_options[:protocol] = Gitlab.config.web_protocol
default_url_options[:port] = Gitlab.config.web_port default_url_options[:port] = Gitlab.config.web_port if Gitlab.config.web_custom_port?
default from: Gitlab.config.email_from default from: Gitlab.config.email_from
......
...@@ -20,17 +20,25 @@ class Settings < Settingslogic ...@@ -20,17 +20,25 @@ class Settings < Settingslogic
def web_port def web_port
if web.https if web.https
nil web['port'] = 443
else else
web['port'] ||= 80 web['port'] ||= 80
end.to_i
end end
def web_custom_port?
![443, 80].include?(web_port)
end end
def build_url def build_url
raw_url = self.web_protocol raw_url = self.web_protocol
raw_url << "://" raw_url << "://"
raw_url << web_host raw_url << web_host
raw_url << ":#{web_port}" if web_port.to_i != 80
if web_custom_port?
raw_url << ":#{web_port}"
end
raw_url raw_url
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment