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, GetURL: get_url,
StoreURL: store_url, StoreURL: store_url,
DeleteURL: delete_url, DeleteURL: delete_url,
MultipartUpload: multipart_upload_hash MultipartUpload: multipart_upload_hash,
CustomPutHeaders: true,
PutHeaders: upload_options
}.compact }.compact
end end

View file

@ -61,6 +61,8 @@ describe ObjectStorage::DirectUpload do
expect(subject[:GetURL]).to start_with(storage_url) expect(subject[:GetURL]).to start_with(storage_url)
expect(subject[:StoreURL]).to start_with(storage_url) expect(subject[:StoreURL]).to start_with(storage_url)
expect(subject[:DeleteURL]).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
end end