summaryrefslogtreecommitdiffstats
path: root/app/controllers/trees_controller.rb
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2009-03-02 15:28:30 +0100
committerJohan Sørensen <johan@johansorensen.com>2009-04-22 15:15:25 +0200
commit890d028105c770f6ffa49b92168a30324eab574d (patch)
tree45f89dc60adf6016c3b4a679c110dd659c1659a3 /app/controllers/trees_controller.rb
parent92f3fe1d301c57497de5b7db222c11f34ea7117b (diff)
downloadgitorious-mainline-outdated-890d028105c770f6ffa49b92168a30324eab574d.zip
gitorious-mainline-outdated-890d028105c770f6ffa49b92168a30324eab574d.tar.gz
gitorious-mainline-outdated-890d028105c770f6ffa49b92168a30324eab574d.tar.bz2
Set the correct filename header for the tarball filename
Diffstat (limited to 'app/controllers/trees_controller.rb')
-rw-r--r--app/controllers/trees_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/trees_controller.rb b/app/controllers/trees_controller.rb
index ccdaaff..ded1a69 100644
--- a/app/controllers/trees_controller.rb
+++ b/app/controllers/trees_controller.rb
@@ -55,13 +55,13 @@ class TreesController < ApplicationController
redirect_to project_repository_path(@project, @repository) and return
end
- user_path = "#{@repository.owner.to_param}-#{@repository.to_param}-#{@ref}.#{ext}"
+ user_path = "#{@repository.project_or_owner.to_param}-#{@repository.to_param}-#{@ref}.#{ext}"
disk_path = "#{@repository.hashed_path}-#{@commit.id}.#{ext}"
if File.exist?(File.join(GitoriousConfig["archive_cache_dir"], disk_path))
respond_to do |format|
format.html {
set_xsendfile_headers(disk_path, user_path)
- render :nothing => true, :status => :ok and return
+ head(:ok) and return
}
format.js {
render :partial => "archive_ready"
@@ -91,7 +91,7 @@ class TreesController < ApplicationController
response.headers["X-Sendfile"] = File.join(GitoriousConfig["archive_cache_dir"], real_path)
response.headers["Content-Type"] = content_type
user_path = user_path.gsub("/", "_")
- response.headers["Content-Disposition"] = "Content-Disposition: attachment; file=\"#{user_path}\""
+ response.headers["Content-Disposition"] = "Content-Disposition: attachment; filename=\"#{user_path}\""
end
def publish_archive_message(repo, disk_path, commit)