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

fix: name calculation #5266

Merged

Conversation

khoelldobler
Copy link
Contributor

Fixes Issue

Description of Change

The current name calculation just looks for the last occurence of the string "node_modules" and calculates a substring after the occurence plus 1 arbitrary additional character. However, if this string is used as part of the package name the calculation ist wrong and the dependency check crashes with:
"Could not perform Node Audit analysis. Invalid payload submitted to Node Audit API".

We ran into this problem as we updated to the latest gradle plugin version due to #5220 and having "node_modules-path" as a transitive dependency.

I added the slash to the indexOf check to ensure the right pattern is matched.

Have test cases been added to cover the new functionality?

no

@boring-cyborg boring-cyborg bot added the core changes to core label Jan 10, 2023
@jeremylong jeremylong changed the title fix name calculation fix: name calculation Jan 10, 2023
@jeremylong jeremylong added this to the 8.0.0 milestone Jan 10, 2023
@jeremylong jeremylong merged commit 94634c6 into jeremylong:main Jan 10, 2023
@jeremylong
Copy link
Owner

thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core changes to core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants