Swap clauses as per code review suggestion

This commit is contained in:
George Koltsov 2019-08-15 10:11:35 +01:00
parent 879bcaac26
commit 2857a40950
1 changed files with 1 additions and 1 deletions

View File

@ -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 workhorse_excluded_content_types.include?(response.content_type) && (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