Files
imgproxy/security/source.go
2025-09-12 13:49:07 +02:00

18 lines
396 B
Go

package security
// VerifySourceURL checks if the given imageURL is allowed based on
// the configured AllowedSources.
func (s *Checker) VerifySourceURL(imageURL string) error {
if len(s.config.AllowedSources) == 0 {
return nil
}
for _, allowedSource := range s.config.AllowedSources {
if allowedSource.MatchString(imageURL) {
return nil
}
}
return newSourceURLError(imageURL)
}