Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-01-15 20:12:36 +0300
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-01-15 20:12:36 +0300
commit67a6fee5b124a768279b0681b52be19f138530dc (patch)
treec3a999937b659454e0426c99e858e71fbfaa5447 /app/controllers/projects/raw_controller.rb
parentaeb5ef20cf0683c884a74c1e7a96b26c6eb2eebf (diff)
Prototype of Git blobs via workhorse
Diffstat (limited to 'app/controllers/projects/raw_controller.rb')
-rw-r--r--app/controllers/projects/raw_controller.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb
index be7d5c187fe..e55cdea94ae 100644
--- a/app/controllers/projects/raw_controller.rb
+++ b/app/controllers/projects/raw_controller.rb
@@ -1,3 +1,5 @@
+require 'base64'
+
# Controller for viewing a file's raw
class Projects::RawController < Projects::ApplicationController
include ExtractsPath
@@ -15,7 +17,10 @@ class Projects::RawController < Projects::ApplicationController
if @blob.lfs_pointer?
send_lfs_object
else
- stream_data
+ headers['Gitlab-Workhorse-Repo-Path'] = @repository.path_to_repo
+ headers['Gitlab-Workhorse-Send-Blob'] = Base64.urlsafe_encode64(@commit.id + ':' + @path)
+ headers['Content-Disposition'] = 'inline'
+ render nothing: true, content_type: get_blob_type
end
else
render_404
@@ -34,16 +39,6 @@ class Projects::RawController < Projects::ApplicationController
end
end
- def stream_data
- type = get_blob_type
-
- send_data(
- @blob.data,
- type: type,
- disposition: 'inline'
- )
- end
-
def send_lfs_object
lfs_object = find_lfs_object