Commit fcc2d214 authored by Stan Hu's avatar Stan Hu

Merge branch '246741-conan-unicorn-bug' into 'master'

Use 'read' method to get request body in Conan

See merge request gitlab-org/gitlab!41801
parents bb9bd05e 81e2dd75
---
title: Use 'read' method to get request body in Conan to fix uploads when using Unicorn
merge_request: 41801
author:
type: fixed
......@@ -140,7 +140,7 @@ module API
end
def file_names
json_payload = Gitlab::Json.parse(request.body.string)
json_payload = Gitlab::Json.parse(request.body.read)
bad_request!(nil) unless json_payload.is_a?(Hash)
......
......@@ -383,6 +383,16 @@ RSpec.describe API::ConanPackages do
end
end
shared_examples 'successful response when using Unicorn' do
context 'on Unicorn', :unicorn do
it 'returns successfully' do
subject
expect(response).to have_gitlab_http_status(:ok)
end
end
end
describe 'GET /api/v4/packages/conan/v1/conans/:package_name/package_version/:package_username/:package_channel' do
let(:recipe_path) { package.conan_recipe_path }
......@@ -478,6 +488,7 @@ RSpec.describe API::ConanPackages do
it_behaves_like 'rejects invalid recipe'
it_behaves_like 'rejects invalid upload_url params'
it_behaves_like 'successful response when using Unicorn'
it 'returns a set of upload urls for the files requested' do
subject
......@@ -541,6 +552,7 @@ RSpec.describe API::ConanPackages do
it_behaves_like 'rejects invalid recipe'
it_behaves_like 'rejects invalid upload_url params'
it_behaves_like 'successful response when using Unicorn'
it 'returns a set of upload urls for the files requested' do
expected_response = {
......
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