mirror of
1
Fork 0

Check for empty path in IRI

This commit is contained in:
erik 2023-12-07 12:03:28 +01:00 committed by Michael Jerger
parent f84e0b27e1
commit 25d34e0c14
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ func ValidateAndParseIRI(unvalidatedIRI string) (url.URL, error) {
return url.URL{}, err
}
if len(validatedURL.Path) <= 1 {
return url.URL{}, fmt.Errorf("path was empty")
}
return *validatedURL, nil
}