From 9850824eb77a6d06230624e1e2b17803ff286b39 Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Sun, 16 Jun 2024 08:24:18 -0400 Subject: [PATCH] remove permanent_redirects as no longer needed --- data.go | 1 - main.go | 5 ----- 2 files changed, 6 deletions(-) diff --git a/data.go b/data.go index 4ce533f..f47084a 100644 --- a/data.go +++ b/data.go @@ -44,7 +44,6 @@ type Configuration struct { CMSHeaders bool `json:"cms_headers"` // set CMS headers RedirectURL string `json:"redirect_url"` // redirect auth url for proxy server Verbose int `json:"verbose"` // verbose output - PermanentRedirects []string `json:"permanent_redirects"` // list of permanent redirects Ingress []Ingress `json:"ingress"` // incress section ServerCrt string `json:"server_cert"` // server certificate ServerKey string `json:"server_key"` // server certificate diff --git a/main.go b/main.go index caaccbf..3397d96 100644 --- a/main.go +++ b/main.go @@ -209,11 +209,6 @@ func srvURL(surl string) string { // helper function to redirect HTTP requests based on configuration ingress rules func redirect(w http.ResponseWriter, r *http.Request) { - // check for permanent redirects first - if InList(r.URL.Path, Config.PermanentRedirects) { - path := fmt.Sprintf("%s/index.html", r.URL.Path) - r.URL.Path = strings.Replace(path, "//", "/", -1) - } // get redirect rule map and rules (in reverse order) // here the reverse order will provide /path/rse /path/aaa followed by /path, etc. // such that we can match the /path as last reserve