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

no-url-protocols regex too aggressive (reports data-urls) #340

Closed
benthemonkey opened this issue Oct 23, 2015 · 0 comments
Closed

no-url-protocols regex too aggressive (reports data-urls) #340

benthemonkey opened this issue Oct 23, 2015 · 0 comments
Assignees
Labels

Comments

@benthemonkey
Copy link
Member

Here's the offending code (in /lib/rules/no-url-protocols.js):

var isUrlRegex = /^(http(s?)):\/\/|\/\//;

It reports data-urls which have two consecutive slashes in them. The regex should be changed to report urls that begin with http(s):// or //. There are a number of ways to clean up the regex. Here's my suggested, simplified regex: /^(https?:)?\/\//

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

No branches or pull requests

1 participant