Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-04-17 17:58:41 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2016-04-20 00:17:49 +0300
commitbf4371d60d651ffddd6b70aaa4bfde4f0e05c388 (patch)
treed097d4bdaedf766ad7557729aea4fcc035a5d3aa /app/controllers/projects/builds_controller.rb
parent27d1349f2b2a909565073ef144acc51295313f50 (diff)
Switch raw trace to use X-Sendfile header
Diffstat (limited to 'app/controllers/projects/builds_controller.rb')
-rw-r--r--app/controllers/projects/builds_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index c45e9809a83..286950d388e 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -1,7 +1,7 @@
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?
- render json: { trace_file: @build.path_to_trace }
+ response.headers['X-Sendfile'] = @build.path_to_trace
else
- render json: {}, status: 404
+ response.status = 404
end
+
+ render nothing: true
end
private