diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-15 15:01:34 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-15 15:01:34 +0300 |
commit | 36a729f05f1b9c2b3935b9d121b8fe3172ce5cc1 (patch) | |
tree | ae07698ca456be7a83c3267bf54909594ff2283f /app/controllers | |
parent | 2c71a94744eba516d10725302ce7ffeb5d4625ab (diff) | |
parent | 2857a40950d23173e4280513a5f318b89d1d0a11 (diff) |
Merge branch 'georgekoltsov/48854-fix-empty-flash-message' into 'master'
Exclude json content type from workhorse interception
See merge request gitlab-org/gitlab-ce!31809
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1d55a073f3b..5e65084a110 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -116,7 +116,7 @@ class ApplicationController < ActionController::Base def render(*args) super.tap do # Set a header for custom error pages to prevent them from being intercepted by gitlab-workhorse - if response.content_type == 'text/html' && (400..599).cover?(response.status) + if (400..599).cover?(response.status) && workhorse_excluded_content_types.include?(response.content_type) response.headers['X-GitLab-Custom-Error'] = '1' end end @@ -124,6 +124,10 @@ class ApplicationController < ActionController::Base protected + def workhorse_excluded_content_types + @workhorse_excluded_content_types ||= %w(text/html application/json) + end + def append_info_to_payload(payload) super |