Skip to content
代码片段 群组 项目
提交 91d48fd8 编辑于 作者: Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak
浏览文件

Merge branch '345920-dp-regex-update' into 'master'

Update Dependency Proxy container_image regex to allow 4 levels

See merge request gitlab-org/gitlab!80929
No related branches found
No related tags found
无相关合并请求
...@@ -255,7 +255,7 @@ def full_snippets_repository_path_regex ...@@ -255,7 +255,7 @@ def full_snippets_repository_path_regex
end end
def container_image_regex def container_image_regex
@container_image_regex ||= %r{([\w\.-]+\/){0,1}[\w\.-]+}.freeze @container_image_regex ||= %r{([\w\.-]+\/){0,4}[\w\.-]+}.freeze
end end
def container_image_blob_sha_regex def container_image_blob_sha_regex
......
...@@ -549,10 +549,11 @@ def expect_no_route_match(paths) ...@@ -549,10 +549,11 @@ def expect_no_route_match(paths)
it { is_expected.to match('gitlab-foss') } it { is_expected.to match('gitlab-foss') }
it { is_expected.to match('gitlab_foss') } it { is_expected.to match('gitlab_foss') }
it { is_expected.to match('gitlab-org/gitlab-foss') } it { is_expected.to match('gitlab-org/gitlab-foss') }
it { is_expected.to match('a/b/c/d/e') }
it { is_expected.to match('100px.com/100px.ruby') } it { is_expected.to match('100px.com/100px.ruby') }
it 'only matches at most one slash' do it 'does not match beyond 4 slashes' do
expect(subject.match('foo/bar/baz')[0]).to eq('foo/bar') expect(subject.match('foo/bar/baz/buz/zip/zap/zoo')[0]).to eq('foo/bar/baz/buz/zip')
end end
it 'does not match other non-word characters' do it 'does not match other non-word characters' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册