summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-25 23:00:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-25 23:00:08 +0000
commitffd073a49240263b25ef98867bea6cc261bf7909 (patch)
treec43de093fdcd39657e5782c5ce1be79622b74fd8 /app
parent0ce33bd2eaa8fe22ad59d7c198bb700f80503db9 (diff)
downloadgitlab-ce-ffd073a49240263b25ef98867bea6cc261bf7909.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-ee
Diffstat (limited to 'app')
-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