Skip to content

Commit

Permalink
remove permanent_redirects as no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jun 16, 2024
1 parent 0d057e8 commit 9850824
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9850824

Please sign in to comment.