Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More about this vulnerability button don't work #54

Open
dzienisz opened this issue Sep 29, 2020 · 5 comments
Open

More about this vulnerability button don't work #54

dzienisz opened this issue Sep 29, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dzienisz
Copy link

Screenshot 2020-09-29 at 13 42 34

Screenshot 2020-09-29 at 13 42 44

@nprail
Copy link
Member

nprail commented Sep 29, 2020

Oh, looks like that field can be a comma-separated list of URLs. Should be fairly easy to resolve.

@nprail nprail self-assigned this Sep 29, 2020
@nprail nprail added the bug Something isn't working label Sep 29, 2020
@dzienisz
Copy link
Author

I can fix it as #hacktoberfest issue

@dzienisz
Copy link
Author

dzienisz commented Oct 17, 2020

@nprail can you help me?

I see that we render this list by using {{#if references}} but it sometimes return markdown data and sometimes urls separated by comma 🤯

I can't find in code where {{references}} is created.

@nprail
Copy link
Member

nprail commented Oct 19, 2020

@dzienisz references comes from directly from npm audit --json without manipulation. We will probably have to loop through the advisories and parse that field somehow into a consistent format.

Here is a possible algorithm to determine if it is a comma separated list of URLs:

const splitList = advisory.references.split(',')

let isUrlList = true
for (const urlItem of splitList) {
  try {
    new URL(urlItem)
  } catch (err) {
    // if new URL throws an error, than the item isn't a valid URL
    isUrlList = false
  }
}

// if any of the items do not parse as a URL then it probably isn't a comma-separated list of URLs
return isUrlList

@dzienisz
Copy link
Author

dzienisz commented Sep 5, 2022

Hey @nprail currently I don't have time to do this. Anybody can take that.

I see you stopped supporting this code. Do you plan to find another contributors or archive the project?

@dzienisz dzienisz closed this as completed Sep 5, 2022
@dzienisz dzienisz reopened this Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants