Skip to content

Commit

Permalink
Improve normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMart committed Jun 7, 2024
1 parent fbc2504 commit 51533be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/platforms/intigriti/scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.find_category(scope)
def self.normalize(endpoint)
endpoint = sanitize_endpoint(endpoint)

if endpoint.match?(%r{^(https?://|\*\.)[/\w.\-?#!%:=]+$}) || endpoint.match?(%r{^[/\w.-]+\.[a-z]+(/.*)?})
if endpoint.match?(%r{^(https?://|\*\.)[/\w.\-?#!%:=]+$}i) || endpoint.match?(%r{^[/\w.-]+\.[a-z]+(/.*)?}i)
endpoint.downcase
else
Utilities.log_warn("Intigriti - Non-normalized endpoint : #{endpoint}")
Expand Down
2 changes: 1 addition & 1 deletion libs/platforms/yeswehack/scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.normalize_urls(scope)
normalized_urls.concat(normalize_with_tlds(match_data[1], match_data[2]))
elsif scope.match?(%r{https?://\*})
normalized_urls << scope.sub(%r{https?://}, '')
elsif scope.match?(%r{^(https?://|\*\.)[/\w.\-?#!%:=]+$}) || scope.match?(%r{^[/\w.-]+\.[a-z]+(/.*)?})
elsif scope.match?(%r{^(https?://|\*\.)[/\w.\-?#!%:=]+$}) || scope.match?(%r{^[/\w.-]+\.[a-z]+(/.*)?}i)
normalized_urls << scope
else
Utilities.log_warn("YesWeHack - Non-normalized scope : #{scope}")
Expand Down

0 comments on commit 51533be

Please sign in to comment.