diff options
| author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-04-17 16:58:41 +0200 |
|---|---|---|
| committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-04-19 23:17:49 +0200 |
| commit | bf4371d60d651ffddd6b70aaa4bfde4f0e05c388 (patch) | |
| tree | d097d4bdaedf766ad7557729aea4fcc035a5d3aa | |
| parent | 27d1349f2b2a909565073ef144acc51295313f50 (diff) | |
| download | gitlab-ce-bf4371d60d651ffddd6b70aaa4bfde4f0e05c388.tar.gz | |
Switch raw trace to use X-Sendfile header
| -rw-r--r-- | app/controllers/projects/builds_controller.rb | 9 | ||||
| -rw-r--r-- | config/routes.rb | 2 |
2 files changed, 7 insertions, 4 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 diff --git a/config/routes.rb b/config/routes.rb index bc48728470f..79b62a0b1bb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 |
