1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-23 11:14:48 +02:00
imgproxy/security/source.go

18 lines
308 B
Go
Raw Normal View History

2021-04-26 17:52:50 +06:00
package security
import (
2021-09-30 20:23:30 +06:00
"github.com/imgproxy/imgproxy/v3/config"
2021-04-26 17:52:50 +06:00
)
func VerifySourceURL(imageURL string) bool {
if len(config.AllowedSources) == 0 {
return true
}
2021-09-07 19:04:33 +06:00
for _, allowedSource := range config.AllowedSources {
if allowedSource.MatchString(imageURL) {
2021-04-26 17:52:50 +06:00
return true
}
}
return false
}