mirror of
https://github.com/openziti/zrok.git
synced 2026-08-24 02:34:20 -05:00
Fix interstitial never displaying when UserAgentPrefixes is configured
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user