Skip to content

Single-quoted strings in importmap.rb #156

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

Closed
nsilva-ta opened this issue Nov 7, 2022 · 3 comments
Closed

Single-quoted strings in importmap.rb #156

nsilva-ta opened this issue Nov 7, 2022 · 3 comments

Comments

@nsilva-ta
Copy link

Shouldn't we use single-quoted strings inside importmap.rb by default?

When there is a single-quoted string inside importmap.rb, as following example:

pin 'jquery' # @3.4.1

the entry will be ignored when the command ./bin/importmap audit is executed, and the vulnerability in the version of jquery is not reported.

@dhh
Copy link
Member

dhh commented Dec 25, 2022

Not a fan of single quotes. We've moved to double quotes everywhere. Sounds like it's a bug in the audit regexp not recognizing both. Do explore a fix to that 👍

@dkniffin
Copy link
Contributor

The issue is on this line:

importmap.scan(/^pin "([^"]*)".* #.*@(\d+\.\d+\.\d+(?:[^\s]*)).*$/)

It only checks for double-quotes. The regex needs to be updated to handle single quotes as well

@dhh
Copy link
Member

dhh commented Jun 18, 2023

Feel free to add a PR that also picks up single quotes for this.

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

No branches or pull requests

3 participants