Commit 9cf966b3 authored by Stan Hu's avatar Stan Hu

Fix auto-reloading of multipart.rb

During development, it's quite common to see the error:

```
A copy of Gitlab::Middleware::Multipart has been removed from the module
tree but is still active!
```

Prefixing the uploaders with :: should prevent this from happening. See
https://stackoverflow.com/a/29710188/1992201 for more details.
parent 2e7091e2
...@@ -123,9 +123,9 @@ module Gitlab ...@@ -123,9 +123,9 @@ module Gitlab
def allowed_paths def allowed_paths
[ [
::FileUploader.root, ::FileUploader.root,
Gitlab.config.uploads.storage_path, ::Gitlab.config.uploads.storage_path,
JobArtifactUploader.workhorse_upload_path, ::JobArtifactUploader.workhorse_upload_path,
LfsObjectUploader.workhorse_upload_path, ::LfsObjectUploader.workhorse_upload_path,
File.join(Rails.root, 'public/uploads/tmp') File.join(Rails.root, 'public/uploads/tmp')
] + package_allowed_paths ] + package_allowed_paths
end end
...@@ -139,9 +139,9 @@ module Gitlab ...@@ -139,9 +139,9 @@ module Gitlab
encoded_message = env.delete(RACK_ENV_KEY) encoded_message = env.delete(RACK_ENV_KEY)
return @app.call(env) if encoded_message.blank? return @app.call(env) if encoded_message.blank?
message = Gitlab::Workhorse.decode_jwt(encoded_message)[0] message = ::Gitlab::Workhorse.decode_jwt(encoded_message)[0]
Handler.new(env, message).with_open_files do ::Gitlab::Middleware::Multipart::Handler.new(env, message).with_open_files do
@app.call(env) @app.call(env)
end end
rescue UploadedFile::InvalidPathError => e rescue UploadedFile::InvalidPathError => e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment