-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add an autocorrect for insecure gitlab/github source/issue url metadata #82
Conversation
These represent almost all of the community cookbook and this makes sure folks are using secure URLs Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
|
||
def autocorrect(node) | ||
lambda do |corrector| | ||
corrector.replace(node.loc.expression, node.source.gsub(%r{http://(www.)*}, 'https://')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this replacer will remove www
from the string since it will match on it. I think you could just .gsub(%r{^http://}, 'https://')
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing www is part of it. Those just redirect on both sites
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I did not realize that
Signed-off-by: Tim Smith <tsmith@chef.io>
|
||
def autocorrect(node) | ||
lambda do |corrector| | ||
corrector.replace(node.loc.expression, node.source.gsub(%r{http://(www.)*}, 'https://')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I did not realize that
These represent almost all of the community cookbook and this makes sure folks are using secure URLs
Signed-off-by: Tim Smith tsmith@chef.io