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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 21:09:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 21:09:23 +0300
commit76e9fc7b29c1ce716c26932e9fbec0f3c99f53f4 (patch)
treeb5ca8e3a6b2cf93b67257b38ee71e2efee177700 /lib/gitlab/middleware
parenta210c43e0aca0311cc1d3d381763b25979ec72dc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/middleware')
-rw-r--r--lib/gitlab/middleware/multipart.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/gitlab/middleware/multipart.rb b/lib/gitlab/middleware/multipart.rb
index 0ee9563c227..cb4213d23a4 100644
--- a/lib/gitlab/middleware/multipart.rb
+++ b/lib/gitlab/middleware/multipart.rb
@@ -84,12 +84,6 @@ module Gitlab
end
def open_file(params, key)
- allowed_paths = [
- ::FileUploader.root,
- Gitlab.config.uploads.storage_path,
- File.join(Rails.root, 'public/uploads/tmp')
- ]
-
::UploadedFile.from_params(params, key, allowed_paths)
end
@@ -106,6 +100,16 @@ module Gitlab
# inside other env keys, here we ensure everything is updated correctly
ActionDispatch::Request.new(@request.env).update_param(key, value)
end
+
+ private
+
+ def allowed_paths
+ [
+ ::FileUploader.root,
+ Gitlab.config.uploads.storage_path,
+ File.join(Rails.root, 'public/uploads/tmp')
+ ]
+ end
end
def initialize(app)
@@ -125,3 +129,5 @@ module Gitlab
end
end
end
+
+::Gitlab::Middleware::Multipart::Handler.prepend_if_ee('EE::Gitlab::Middleware::Multipart::Handler')