Skip to content

Commit

Permalink
Fix:Missing regular expression anchor
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Jason Cameron <jasoncameron.all@gmail.com>
  • Loading branch information
1 parent 35886ee commit 2888b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ranges/fetchers/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (f AzurePublicCloudFetcher) FetchIPRanges() ([]string, error) {
}

// Step 2: Extract the JSON download URL using a regex
urlRegex := regexp.MustCompile(`https://download\.microsoft\.com/.*?\.json`)
urlRegex := regexp.MustCompile(`^https://download\.microsoft\.com/.*?\.json$`)
matches := urlRegex.FindStringSubmatch(string(body))
if len(matches) == 0 {
return nil, fmt.Errorf("failed to find JSON download URL in Azure download page")
Expand Down

0 comments on commit 2888b2b

Please sign in to comment.