Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect cache key #286

Merged
merged 1 commit into from
Nov 22, 2023
Merged

fix: incorrect cache key #286

merged 1 commit into from
Nov 22, 2023

Conversation

HolgerHuo
Copy link
Contributor

In 4003b03, we deprecated ProxyMode switch, making this condition unavailable. We can simply detect proxy usage by the etag variable passed in.

@n0vad3v
Copy link
Member

n0vad3v commented Nov 11, 2023

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
	}
}

@HolgerHuo
Copy link
Contributor Author

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.

@n0vad3v
Copy link
Member

n0vad3v commented Nov 22, 2023

Oh, I got you, yes it's indeed a problem here, merging this PR now, thanks for you contribution!

@n0vad3v n0vad3v merged commit 290b233 into webp-sh:master Nov 22, 2023
4 of 6 checks passed
@HolgerHuo HolgerHuo deleted the fix-incorrect-cache-key branch November 22, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants