1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00
imgproxy/security/source.go
2021-09-30 20:23:30 +06:00

18 lines
308 B
Go

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