Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
app/controllers/projects/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
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
...
...
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