Commit 877c8889 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'sh-fix-multipart-upload-signed-urls' into 'master'

Fix object storage uploads not working with AWS v2

Closes gitlab-workhorse#181

See merge request gitlab-org/gitlab-ce!21731
parents abdb0d36 244ed8ad
---
title: Fix object storage uploads not working with AWS v2
merge_request: 21731
author:
type: fixed
......@@ -89,7 +89,7 @@ module ObjectStorage
method: 'PUT',
bucket_name: bucket_name,
object_name: object_name,
query: { uploadId: upload_id, partNumber: part_number },
query: { 'uploadId' => upload_id, 'partNumber' => part_number },
headers: upload_options
}, expire_at)
end
......@@ -100,7 +100,7 @@ module ObjectStorage
method: 'POST',
bucket_name: bucket_name,
object_name: object_name,
query: { uploadId: upload_id },
query: { 'uploadId' => upload_id },
headers: { 'Content-Type' => 'application/xml' }
}, expire_at)
end
......@@ -111,7 +111,7 @@ module ObjectStorage
method: 'DELETE',
bucket_name: bucket_name,
object_name: object_name,
query: { uploadId: upload_id }
query: { 'uploadId' => upload_id }
}, expire_at)
end
......
......@@ -83,6 +83,16 @@ describe ObjectStorage::DirectUpload do
expect(subject[:MultipartUpload][:AbortURL]).to start_with(storage_url)
expect(subject[:MultipartUpload][:AbortURL]).to include('uploadId=myUpload')
end
it 'uses only strings in query parameters' do
expect(direct_upload.send(:connection)).to receive(:signed_url).at_least(:once) do |params|
if params[:query]
expect(params[:query].keys.all? { |key| key.is_a?(String) }).to be_truthy
end
end
subject
end
end
shared_examples 'a valid upload without multipart data' do
......
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