diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-16 12:53:54 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-01-31 22:50:40 +0000 |
commit | fa68e403e0d5539b19ceb5396394d634babdc2b9 (patch) | |
tree | f4e423e06bd4204d18f87783f024bd4e568c4964 /app/models/project.rb | |
parent | ac09f857cd9edd4a18280f617b48fe436109ceaa (diff) | |
download | gitlab-ce-fa68e403e0d5539b19ceb5396394d634babdc2b9.tar.gz |
Support https and custom port for pages
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 48ff5ec7fc7..aa16b055e81 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1165,11 +1165,14 @@ class Project < ActiveRecord::Base def pages_url if Dir.exist?(public_pages_path) host = "#{namespace.path}.#{Settings.pages.domain}" + url = Gitlab.config.pages.url.sub(/^https?:\/\//) do |prefix| + "#{prefix}#{namespace.path}." + end # If the project path is the same as host, leave the short version - return "http://#{host}" if host == path + return url if host == path - "http://#{host}/#{path}" + "#{url}/#{path}" end end |