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:
Diffstat (limited to 'lib/gitlab/hotlinking_detector.rb')
-rw-r--r--lib/gitlab/hotlinking_detector.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/hotlinking_detector.rb b/lib/gitlab/hotlinking_detector.rb
index b5000777010..e81983cd014 100644
--- a/lib/gitlab/hotlinking_detector.rb
+++ b/lib/gitlab/hotlinking_detector.rb
@@ -25,6 +25,11 @@ module Gitlab
return true if INVALID_FORMATS.include?(request_accepts.first)
false
+
+ rescue ActionDispatch::Http::MimeNegotiation::InvalidType, Mime::Type::InvalidMimeType
+ # Malformed requests with invalid MIME types prevent the checks from
+ # being executed correctly, so we should intercept those requests.
+ true
end
private