Commit aaf44e0b authored by Michelle Gill's avatar Michelle Gill Committed by Douglas Barbosa Alexandre

Return 404 when rendering Repositories#Archive as HTML

parent ee97aba0
......@@ -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?
......
---
title: Return 404 when repository archive cannot be retrieved
merge_request: 23926
author:
type: fixed
......@@ -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
......
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