Skip to content
Snippets Groups Projects
Commit 67a6fee5 authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Prototype of Git blobs via workhorse

parent aeb5ef20
No related branches found
No related tags found
No related merge requests found
require 'base64'
# Controller for viewing a file's raw
class Projects::RawController < Projects::ApplicationController
include ExtractsPath
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment