Commit 2595e7a6 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'john_long-composer-package-relative-url' into 'master'

Fix relative URL with composer package

See merge request gitlab-org/gitlab!53918
parents fb175e5f 33c6a8cd
......@@ -11,7 +11,7 @@ module Packages
end
def root
path = api_v4_group___packages_composer_package_name_path({ id: @group.id, package_name: '%package%$%hash%', format: '.json' }, true)
path = expose_path(api_v4_group___packages_composer_package_name_path({ id: @group.id, package_name: '%package%$%hash%', format: '.json' }, true))
{ 'packages' => [], 'provider-includes' => { 'p/%hash%.json' => { 'sha256' => provider_sha } }, 'providers-url' => path }
end
......
---
title: Fix relative URL with composer package
merge_request: 53918
author:
type: fixed
......@@ -67,10 +67,14 @@ RSpec.describe ::Packages::Composer::PackagesPresenter do
{
'packages' => [],
'provider-includes' => { 'p/%hash%.json' => { 'sha256' => /^\h+$/ } },
'providers-url' => "/api/v4/group/#{group.id}/-/packages/composer/%package%$%hash%.json"
'providers-url' => "prefix/api/v4/group/#{group.id}/-/packages/composer/%package%$%hash%.json"
}
end
before do
stub_config(gitlab: { relative_url_root: 'prefix' })
end
it 'returns the provider json' do
expect(subject).to match(expected_json)
end
......
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