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 'app/controllers/repositories/lfs_storage_controller.rb')
-rw-r--r--app/controllers/repositories/lfs_storage_controller.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/repositories/lfs_storage_controller.rb b/app/controllers/repositories/lfs_storage_controller.rb
index 48784842d48..36912948b77 100644
--- a/app/controllers/repositories/lfs_storage_controller.rb
+++ b/app/controllers/repositories/lfs_storage_controller.rb
@@ -21,7 +21,17 @@ module Repositories
def upload_authorize
set_workhorse_internal_api_content_type
- authorized = LfsObjectUploader.workhorse_authorize(has_length: true)
+ # We don't actually know whether Workhorse received an LFS upload
+ # request with a Content-Length header or `Transfer-Encoding:
+ # chunked`. Since we don't know, we need to be pessimistic and
+ # set `has_length` to `false` so that multipart uploads will be
+ # used for AWS. Otherwise, AWS will respond with `501 NOT IMPLEMENTED`
+ # error because a PutObject request with `Transfer-Encoding: chunked`
+ # is not supported.
+ #
+ # This is only an issue with object storage-specific settings, not
+ # with consolidated object storage settings.
+ authorized = LfsObjectUploader.workhorse_authorize(has_length: false, maximum_size: size)
authorized.merge!(LfsOid: oid, LfsSize: size)
render json: authorized