Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
59baa51b
Commit
59baa51b
authored
Dec 02, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond with 204 no content when pages domain does not exist
parent
32d804d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/api/internal/pages.rb
lib/api/internal/pages.rb
+1
-1
spec/requests/api/internal/pages_spec.rb
spec/requests/api/internal/pages_spec.rb
+4
-3
No files found.
lib/api/internal/pages.rb
View file @
59baa51b
...
...
@@ -25,7 +25,7 @@ module API
end
get
"/"
do
host
=
Namespace
.
find_by_pages_host
(
params
[
:host
])
||
PagesDomain
.
find_by_domain
(
params
[
:host
])
no
t_found
!
unless
host
no
_content
!
unless
host
virtual_domain
=
host
.
pages_virtual_domain
no_content!
unless
virtual_domain
...
...
spec/requests/api/internal/pages_spec.rb
View file @
59baa51b
...
...
@@ -47,11 +47,12 @@ describe API::Internal::Pages do
project
.
mark_pages_as_deployed
end
context
'
not existing ho
st'
do
it
'responds with
404 Not Found
'
do
context
'
domain does not exi
st'
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment