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

Prevent domain matches in windows paths #137

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Conversation

cccs-jh
Copy link
Contributor

@cccs-jh cccs-jh commented Feb 23, 2024

C:\path\looks-like-a-domain.tld can cause false positives because the match begins at the \ character and sees looks-like-a-domain.tld as a domain. Not allowing matches to start after \ . - and the \w set instead of just \w (\b) prevents domain matches in windows paths.
- is required else it would match like-a-domain.tld
. is required else C:\path\looks.like.a.domain.tld would match like.a.domain.tld

C:\path\looks-like-a-domain.tld can cause false positives because
the match begins at the \ character and sees looks-like-a-domain.tld
as a domain. Not allowing matches to start after \ . - and the \w set
instead of \w (\b) prevents domain matches in windows paths.
- is required else it would match like-a-domain.tld
. is required else C:\path\looks.like.a.domain.tld would match like.a.domain.tld
@cccs-jh cccs-jh requested a review from cccs-kevin February 23, 2024 22:06
Copy link
Contributor

@cccs-kevin cccs-kevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests please!

@cccs-jh cccs-jh requested a review from cccs-kevin February 23, 2024 22:51
@cccs-jh cccs-jh merged commit fb164bf into main Feb 23, 2024
1 check passed
@cccs-jh cccs-jh deleted the domain_fp_in_windows_path branch February 23, 2024 22:53
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 this pull request may close these issues.

2 participants