Closed HolgerHuo closed 10 months ago
Proxymode is still available on configuration load, there is a function called switchProxyMode
inside LoadConfig
.
func switchProxyMode() {
matched, _ := regexp.MatchString(HttpRegexp, Config.ImgPath)
if matched {
// Enable proxy based on ImgPath should be deprecated in future versions
log.Warn("Enable proxy based on ImgPath will be deprecated in future versions. Use IMG_MAP config options instead")
ProxyMode = true
}
}
Yes, but only IMG_PATH is used to turn on s ProxyMode. If we write proxy backends in multipath style, the switch won't work anymore.
Oh, I got you, yes it's indeed a problem here, merging this PR now, thanks for you contribution!
In https://github.com/webp-sh/webp_server_go/commit/4003b030229327561b54fc26bf6fd1f72086681e, we deprecated ProxyMode switch, making this condition unavailable. We can simply detect proxy usage by the etag variable passed in.