Skip to content

Commit

Permalink
fix(vendor): Remove excessive URL validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mss committed Feb 5, 2025
1 parent 300ca0f commit 1edd529
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions internal/exec/go_getter_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ func ValidateURI(uri string) error {
}
// Maximum length check
if len(uri) > 2048 {
return fmt.Errorf("URI exceeds maximum length of 2048 characters")
return fmt.Errorf("URI exceeds maximum length of 2048 characters: %v", uri)
}
// Add more validation as needed
// Validate URI format
if strings.Contains(uri, "..") {
return fmt.Errorf("URI cannot contain path traversal sequences")
return fmt.Errorf("URI cannot contain path traversal sequences: %v", uri)
}
if strings.Contains(uri, " ") {
return fmt.Errorf("URI cannot contain spaces")
}
// Validate characters
if strings.ContainsAny(uri, "<>|&;$") {
return fmt.Errorf("URI contains invalid characters")
return fmt.Errorf("URI cannot contain spaces: %v", uri)
}
// Validate scheme-specific format
if strings.HasPrefix(uri, "oci://") {
Expand Down

0 comments on commit 1edd529

Please sign in to comment.