summaryrefslogtreecommitdiff
path: root/lib/api/internal/pages.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/internal/pages.rb')
-rw-r--r--lib/api/internal/pages.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/api/internal/pages.rb b/lib/api/internal/pages.rb
index eaa434cff51..003af7f6dd4 100644
--- a/lib/api/internal/pages.rb
+++ b/lib/api/internal/pages.rb
@@ -17,11 +17,18 @@ module API
namespace 'internal' do
namespace 'pages' do
+ desc 'Get GitLab Pages domain configuration by hostname' do
+ detail 'This feature was introduced in GitLab 12.3.'
+ end
+ params do
+ requires :host, type: String, desc: 'The host to query for'
+ end
get "/" do
- host = PagesDomain.find_by_domain(params[:host])
+ host = Namespace.find_by_pages_host(params[:host]) || PagesDomain.find_by_domain(params[:host])
not_found! unless host
virtual_domain = host.pages_virtual_domain
+ no_content! unless virtual_domain
present virtual_domain, with: Entities::Internal::Pages::VirtualDomain
end