skip interstitial for HTTP 'OPTIONS' method (#777)

This commit is contained in:
Michael Quigley 2024-10-24 11:00:00 -04:00
parent 9126c1769e
commit 893a03c8fa
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -158,7 +158,7 @@ func shareHandler(handler http.Handler, pcfg *Config, key []byte, ctx ziti.Conte
if shrToken != "" { if shrToken != "" {
if svc, found := endpoints.GetRefreshedService(shrToken, ctx); found { if svc, found := endpoints.GetRefreshedService(shrToken, ctx); found {
if cfg, found := svc.Config[sdk.ZrokProxyConfig]; found { if cfg, found := svc.Config[sdk.ZrokProxyConfig]; found {
if pcfg.Interstitial != nil && pcfg.Interstitial.Enabled { if r.Method != http.MethodOptions && (pcfg.Interstitial != nil && pcfg.Interstitial.Enabled) {
sendInterstitial := true sendInterstitial := true
if len(pcfg.Interstitial.UserAgentPrefixes) > 0 { if len(pcfg.Interstitial.UserAgentPrefixes) > 0 {
ua := r.Header.Get("User-Agent") ua := r.Header.Get("User-Agent")