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

By default Middleware ignores all URLs #621

Closed
ExMember opened this issue Feb 11, 2021 · 1 comment · Fixed by #622
Closed

By default Middleware ignores all URLs #621

ExMember opened this issue Feb 11, 2021 · 1 comment · Fixed by #622

Comments

@ExMember
Copy link

By default HTMLProofer::Middleware.options[:url_ignore] returns an array with only one regex: /.*/.

This regex matches all non-empty URLs. As a result, all URLs are ignored and options like enforce_https and check_img_http have no effect.

The comment indicates that the intent is to skip local files. A better option would probably be to use a regex that would match URLs that start with a backslash and indicate a relative link, for example. /^\//.

https://github.com/gjtorikian/html-proofer/blob/main/lib/html-proofer/middleware.rb#L25

@gjtorikian
Copy link
Owner

Woof, good catch. Thanks.

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

Successfully merging a pull request may close this issue.

2 participants