Use Rails-way to send file by X-Sendfile
This commit is contained in:
parent
d2dc139d0f
commit
0a13f5f864
|
@ -63,14 +63,11 @@ class Projects::BuildsController < Projects::ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def raw
|
def raw
|
||||||
response.headers['Content-Type'] = 'text/plain; charset=utf-8'
|
|
||||||
if @build.has_trace?
|
if @build.has_trace?
|
||||||
response.headers['X-Sendfile'] = @build.path_to_trace
|
send_file @build.path_to_trace, type: 'text/plain; charset=utf-8', disposition: 'inline'
|
||||||
else
|
else
|
||||||
response.status = 404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
||||||
render nothing: true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in New Issue