diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-10-08 17:12:00 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-10-08 17:12:00 +0200 |
commit | cb13980db88c1d1ae8a5cd766ced4629c657010b (patch) | |
tree | dcf847e462150d560407d7f92baf2509acc8fa62 /app/controllers/projects/repositories_controller.rb | |
parent | a2af080a06b3439d37258d88ac6d6db9ef51c6a5 (diff) | |
download | gitlab-ce-cb13980db88c1d1ae8a5cd766ced4629c657010b.tar.gz |
Let gitlab-git-http-server handle archive downloads
This change relies on changes in gitlab_git and gitlab-git-http-server.
Diffstat (limited to 'app/controllers/projects/repositories_controller.rb')
-rw-r--r-- | app/controllers/projects/repositories_controller.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb index c4a5e2d6359..ba9aea1c165 100644 --- a/app/controllers/projects/repositories_controller.rb +++ b/app/controllers/projects/repositories_controller.rb @@ -11,18 +11,9 @@ class Projects::RepositoriesController < Projects::ApplicationController end def archive - begin - file_path = ArchiveRepositoryService.new(@project, params[:ref], params[:format]).execute - rescue - return head :not_found - end - - if file_path - # Send file to user - response.headers["Content-Length"] = File.open(file_path).size.to_s - send_file file_path - else - redirect_to request.fullpath - end + render json: ArchiveRepositoryService.new(@project, params[:ref], params[:format]).execute + rescue => ex + logger.error("#{self.class.name}: #{ex}") + return git_not_found! end end |