Merge branch 'sh-send-put-headers-object-storage' into 'master'

Send required object storage PUT headers in /uploads/authorize API

See merge request gitlab-org/gitlab-ce!21319
This commit is contained in:
Nick Thomas 2018-09-04 12:11:01 +00:00
commit afb49b044b
3 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
title: Send back required object storage PUT headers in /uploads/authorize API
merge_request: 21319
author:
type: changed

View File

@ -41,7 +41,9 @@ module ObjectStorage
GetURL: get_url,
StoreURL: store_url,
DeleteURL: delete_url,
MultipartUpload: multipart_upload_hash
MultipartUpload: multipart_upload_hash,
CustomPutHeaders: true,
PutHeaders: upload_options
}.compact
end

View File

@ -61,6 +61,8 @@ describe ObjectStorage::DirectUpload do
expect(subject[:GetURL]).to start_with(storage_url)
expect(subject[:StoreURL]).to start_with(storage_url)
expect(subject[:DeleteURL]).to start_with(storage_url)
expect(subject[:CustomPutHeaders]).to be_truthy
expect(subject[:PutHeaders]).to eq({ 'Content-Type' => 'application/octet-stream' })
end
end