Regnology / lucy

Lucy is a component analysis platform to minimize the risk of license infringements and to support and optimize the license compliance process.
MIT License
7 stars 1 forks source link

Invalid License URL from NPM registry breaks BOM upload "invalid URI scheme" #20

Closed savu-a closed 1 year ago

savu-a commented 1 year ago

Describe the bug When uploading a bom file for a product, if the URL received from the NPM registry for downloading the license text is wrong, then the upload process stops and breaks.

To Reproduce Steps to reproduce the behavior:

  1. Upload a bom file that contains btoa version 1.2.1 as a component; ` btoa 1.2.1 pkg:npm/btoa@1.2.1 btoa@1.2.1 npm

    `

  2. Because the registry is returning the following response that contains a wrong URL. repository":{"type":"git","url":"git://git.coolaj86.com/coolaj86/btoa.js.git"}
  3. The function libraryService.urlAutocomplete(dbLibrary); is breaking when trying to download the License and Source code
  4. See error invalid URI scheme git

Expected behavior When encountering invalid URLs Lucy should discard them instead of trying to make the request