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
aaf44e0b
Commit
aaf44e0b
authored
Feb 03, 2020
by
Michelle Gill
Committed by
Douglas Barbosa Alexandre
Feb 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 404 when rendering Repositories#Archive as HTML
parent
ee97aba0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
app/controllers/projects/repositories_controller.rb
app/controllers/projects/repositories_controller.rb
+2
-0
changelogs/unreleased/archive-404.yml
changelogs/unreleased/archive-404.yml
+5
-0
spec/controllers/projects/repositories_controller_spec.rb
spec/controllers/projects/repositories_controller_spec.rb
+8
-0
No files found.
app/controllers/projects/repositories_controller.rb
View file @
aaf44e0b
...
...
@@ -21,6 +21,8 @@ class Projects::RepositoriesController < Projects::ApplicationController
end
def
archive
return
render_404
if
html_request?
set_cache_headers
return
if
archive_not_modified?
...
...
changelogs/unreleased/archive-404.yml
0 → 100644
View file @
aaf44e0b
---
title
:
Return 404 when repository archive cannot be retrieved
merge_request
:
23926
author
:
type
:
fixed
spec/controllers/projects/repositories_controller_spec.rb
View file @
aaf44e0b
...
...
@@ -88,6 +88,14 @@ describe Projects::RepositoriesController do
end
end
context
"when the request format is HTML"
do
it
"renders 404"
do
get
:archive
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
'master'
},
format:
"html"
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
describe
'caching'
do
it
'sets appropriate caching headers'
do
get_archive
...
...
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