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
def allowed_paths
[
::FileUploader.root,
Gitlab.config.uploads.storage_path,
JobArtifactUploader.workhorse_upload_path,
LfsObjectUploader.workhorse_upload_path,
::Gitlab.config.uploads.storage_path,
::JobArtifactUploader.workhorse_upload_path,
::LfsObjectUploader.workhorse_upload_path,
File.join(Rails.root, 'public/uploads/tmp')
] + package_allowed_paths
end
......@@ -139,9 +139,9 @@ module Gitlab
encoded_message = env.delete(RACK_ENV_KEY)
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)
end
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