diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-08-25 13:53:49 +0200 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-09-01 14:00:45 +0200 |
commit | 77295de4076835d6080a9868fe7cb0c08522e141 (patch) | |
tree | f4098224fd1ba66592429508caf2bc0231536686 /app | |
parent | 56011f9f697b7ca42f786735a2249014dd3ef18d (diff) | |
download | gitlab-ce-77295de4076835d6080a9868fe7cb0c08522e141.tar.gz |
Change 404 to 410 error when raw trace is unavailable
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/projects/builds_controller.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bd4ba384b29..78ed12db516 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -117,6 +117,10 @@ class ApplicationController < ActionController::Base render file: Rails.root.join("public", "404"), layout: false, status: "404" end + def render_410 + render file: Rails.root.join("public", "410"), layout: false, status: "410" + end + def no_cache_headers response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] = "no-cache" diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index 4127337cbf2..79d774195f8 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -81,7 +81,7 @@ class Projects::BuildsController < Projects::ApplicationController if @build.has_trace_file? send_file @build.path_to_trace, type: 'text/plain; charset=utf-8', disposition: 'inline' else - render_404 + render_410 end end |