Files
imgproxy/security/source.go
2025-09-11 18:23:29 +02:00

20 lines
331 B
Go

package security
import (
"github.com/imgproxy/imgproxy/v3/config"
)
func VerifySourceURL(imageURL string) error {
if len(config.AllowedSources) == 0 {
return nil
}
for _, allowedSource := range config.AllowedSources {
if allowedSource.MatchString(imageURL) {
return nil
}
}
return newSourceURLError(imageURL)
}