Commit 59baa51b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Respond with 204 no content when pages domain does not exist

parent 32d804d3
......@@ -25,7 +25,7 @@ module API
end
get "/" do
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
no_content! unless virtual_domain
......
......@@ -47,11 +47,12 @@ describe API::Internal::Pages do
project.mark_pages_as_deployed
end
context 'not existing host' do
it 'responds with 404 Not Found' do
context 'domain does not exist' do
it 'responds with 204 no content' do
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
......
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