From dce6cb2d8448e6c59285998f7fc54e1cb23d269a Mon Sep 17 00:00:00 2001 From: ahmyi Date: Thu, 3 Jul 2014 10:57:01 +0800 Subject: [PATCH 1/2] Content-length defined in header response Enable Content-Length to be defined in header response --- app/controllers/projects/repositories_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb index 28fed8b0e3f..c61d2fb8719 100644 --- a/app/controllers/projects/repositories_controller.rb +++ b/app/controllers/projects/repositories_controller.rb @@ -22,6 +22,7 @@ class Projects::RepositoriesController < Projects::ApplicationController if file_path # Send file to user + response.headers['Content-Length'] = File.Open(file_path).size.to_s send_file file_path else render_404 From 4d051e987fb2071bea2f3ee00d8fc16b56648204 Mon Sep 17 00:00:00 2001 From: ahmyi Date: Thu, 3 Jul 2014 11:05:51 +0800 Subject: [PATCH 2/2] Archive with content-length header --- app/controllers/projects/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb index c61d2fb8719..a1da6361234 100644 --- a/app/controllers/projects/repositories_controller.rb +++ b/app/controllers/projects/repositories_controller.rb @@ -22,7 +22,7 @@ class Projects::RepositoriesController < Projects::ApplicationController if file_path # Send file to user - response.headers['Content-Length'] = File.Open(file_path).size.to_s + response.headers["Content-Length"] = File.Open(file_path).size.to_s send_file file_path else render_404