Commit c459d615 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'feature/gb/internal-pages-domain-no-content' into 'master'

Respond with 204 no content when pages domain does not exist

See merge request gitlab-org/gitlab!21059
parents b317d3a3 59baa51b
...@@ -25,7 +25,7 @@ module API ...@@ -25,7 +25,7 @@ module API
end end
get "/" do get "/" do
host = Namespace.find_by_pages_host(params[: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 no_content! unless host
virtual_domain = host.pages_virtual_domain virtual_domain = host.pages_virtual_domain
no_content! unless virtual_domain no_content! unless virtual_domain
......
...@@ -47,11 +47,12 @@ describe API::Internal::Pages do ...@@ -47,11 +47,12 @@ describe API::Internal::Pages do
project.mark_pages_as_deployed project.mark_pages_as_deployed
end end
context 'not existing host' do context 'domain does not exist' do
it 'responds with 404 Not Found' do it 'responds with 204 no content' do
query_host('pages.gitlab.io') query_host('pages.gitlab.io')
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(204)
expect(response.body).to be_empty
end end
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