detect-secrets
detect-secrets copied to clipboard
Check netloc in urlparse result if path is empty
- Please check if the PR fulfills these requirements
- [x] Tests for the changes have been added
- [ ] Docs have been added / updated
- [x] All CI checks are green
- What kind of change does this PR introduce?
This fixes a bug where certain versions of urllib will put the results of a parsed file (e.g. file://testing/custom_filters.py::is_invalid_secret) into the netloc property of urlparse instead of the path property.
- What is the current behavior?
https://github.com/Yelp/detect-secrets/issues/715
-
What is the new behavior (if this is a feature change)? The custom filter parser will now check netloc if path is not populated
-
Does this PR introduce a breaking change?
Users should have to make no changes, as it prefers path over netloc
- Other information:
@a-weiss-programmer thank you for your contribution! Could you advice me on which version have one or the other behaviour?