Commit aaa82070 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch '341888-fix-dep-prox-prefix' into 'master'

Fix dependency proxy image prefix

See merge request gitlab-org/gitlab!71511
parents 03770759 f4c9a981
......@@ -276,7 +276,7 @@ class Group < Namespace
def dependency_proxy_image_prefix
# The namespace path can include uppercase letters, which
# Docker doesn't allow. The proxy expects it to be downcased.
url = "#{web_url.downcase}#{DependencyProxy::URL_SUFFIX}"
url = "#{Gitlab::Routing.url_helpers.group_url(self).downcase}#{DependencyProxy::URL_SUFFIX}"
# Docker images do not include the protocol
url.partition('//').last
......
......@@ -2756,6 +2756,10 @@ RSpec.describe Group do
it 'removes the protocol' do
expect(group.dependency_proxy_image_prefix).not_to include('http')
end
it 'does not include /groups' do
expect(group.dependency_proxy_image_prefix).not_to include('/groups')
end
end
describe '#dependency_proxy_image_ttl_policy' 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