BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
67a6fee5
Commit
67a6fee5
authored
Jan 15, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prototype of Git blobs via workhorse
parent
aeb5ef20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
raw_controller.rb
app/controllers/projects/raw_controller.rb
+6
-11
No files found.
app/controllers/projects/raw_controller.rb
View file @
67a6fee5
require
'base64'
# Controller for viewing a file's raw
# Controller for viewing a file's raw
class
Projects
::
RawController
<
Projects
::
ApplicationController
class
Projects
::
RawController
<
Projects
::
ApplicationController
include
ExtractsPath
include
ExtractsPath
...
@@ -15,7 +17,10 @@ class Projects::RawController < Projects::ApplicationController
...
@@ -15,7 +17,10 @@ class Projects::RawController < Projects::ApplicationController
if
@blob
.
lfs_pointer?
if
@blob
.
lfs_pointer?
send_lfs_object
send_lfs_object
else
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
end
else
else
render_404
render_404
...
@@ -34,16 +39,6 @@ class Projects::RawController < Projects::ApplicationController
...
@@ -34,16 +39,6 @@ class Projects::RawController < Projects::ApplicationController
end
end
end
end
def
stream_data
type
=
get_blob_type
send_data
(
@blob
.
data
,
type:
type
,
disposition:
'inline'
)
end
def
send_lfs_object
def
send_lfs_object
lfs_object
=
find_lfs_object
lfs_object
=
find_lfs_object
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment