Fix interstitial never displaying when UserAgentPrefixes is configured

This commit is contained in:
Dave Hart
2026-04-29 08:17:24 -04:00
parent 44688f324a
commit c437fb3ce7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -253,6 +253,7 @@ func handleInterstitial(w http.ResponseWriter, r *http.Request, pcfg *config, cf
sendInterstitial := true
if len(pcfg.Interstitial.UserAgentPrefixes) > 0 {
sendInterstitial = false
ua := r.Header.Get("User-Agent")
for _, prefix := range pcfg.Interstitial.UserAgentPrefixes {
if strings.HasPrefix(ua, prefix) {
@@ -260,7 +261,6 @@ func handleInterstitial(w http.ResponseWriter, r *http.Request, pcfg *config, cf
break
}
}
sendInterstitial = false
}
if sendInterstitial {
+1 -1
View File
@@ -229,6 +229,7 @@ func handleInterstitial(w http.ResponseWriter, r *http.Request, pcfg *Config, cf
sendInterstitial := true
if len(pcfg.Interstitial.UserAgentPrefixes) > 0 {
sendInterstitial = false
ua := r.Header.Get("User-Agent")
for _, prefix := range pcfg.Interstitial.UserAgentPrefixes {
if strings.HasPrefix(ua, prefix) {
@@ -236,7 +237,6 @@ func handleInterstitial(w http.ResponseWriter, r *http.Request, pcfg *Config, cf
break
}
}
sendInterstitial = false
}
if sendInterstitial {