summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-21 19:07:16 +0000
committermo khan <mo.khan@gmail.com>2020-08-21 19:07:16 +0000
commiteb11eeb1018c4d32e8dbaf3f734e588205f0671f (patch)
treee0595b6d9b1ad9f85969b1c304613420e777b993 /lib
parent366fbf58b1334f771e76b313dac58f568a420e0e (diff)
parent50a62393fe6ba477deb224480a2133482238754e (diff)
Merge branch '207904-bsd-not-precise' into 'master'v3.24.0
Denormalize BSD-4-Clause license See merge request gitlab-org/security-products/license-management!196
Diffstat (limited to 'lib')
-rw-r--r--lib/license/management/repository.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/license/management/repository.rb b/lib/license/management/repository.rb
index 4b6e8a5..3d16b78 100644
--- a/lib/license/management/repository.rb
+++ b/lib/license/management/repository.rb
@@ -64,7 +64,7 @@ module License
{
'id' => name.downcase,
'name' => name,
- 'url' => present?(license.url) ? license.url : ''
+ 'url' => normalized_url(license.url)
}
end
@@ -90,6 +90,13 @@ module License
logger.error(e)
nil
end
+
+ def normalized_url(url)
+ return '' unless present?(url)
+ return 'http://en.wikipedia.org/wiki/BSD_licenses' if url.match?('BSD_licenses#4-clause_license')
+
+ url
+ end
end
end
end