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
Léo-Paul Géneau
gitlab-ce
Commits
bf4371d6
Commit
bf4371d6
authored
Apr 17, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch raw trace to use X-Sendfile header
parent
27d1349f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+6
-3
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/projects/builds_controller.rb
View file @
bf4371d6
class
Projects::BuildsController
<
Projects
::
ApplicationController
before_action
:build
,
except:
[
:index
,
:cancel_all
]
before_action
:authorize_read_build!
,
except:
[
:cancel
,
:cancel_all
,
:retry
]
before_action
:authorize_update_build!
,
except:
[
:index
,
:show
,
:status
,
:raw
_trace
]
before_action
:authorize_update_build!
,
except:
[
:index
,
:show
,
:status
,
:raw
]
layout
'project'
def
index
...
...
@@ -63,11 +63,14 @@ class Projects::BuildsController < Projects::ApplicationController
end
def
raw
response
.
headers
[
'Content-Typei'
]
=
'text/plain'
if
@build
.
has_trace?
re
nder
json:
{
trace_file:
@build
.
path_to_trace
}
re
sponse
.
headers
[
'X-Sendfile'
]
=
@build
.
path_to_trace
else
re
nder
json:
{},
status:
404
re
sponse
.
status
=
404
end
render
nothing:
true
end
private
...
...
config/routes.rb
View file @
bf4371d6
...
...
@@ -669,7 +669,7 @@ Rails.application.routes.draw do
post
:cancel
post
:retry
post
:erase
get
:raw
,
format:
false
get
:raw
end
resource
:artifacts
,
only:
[]
do
...
...
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