diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-05-25 01:06:47 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-05-25 01:06:47 +0200 |
commit | ebce06729ef86b0750808a4fb704bac57e9f60b8 (patch) | |
tree | 20f7f04b94e58a9773b4c95381c95bb6c889e0bc | |
parent | 065a159e5fb94733738c24664ea2bd222bebd203 (diff) |
Some improvements
-rw-r--r-- | server.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -44,7 +44,7 @@ func router(w http.ResponseWriter, r *http.Request) { Name: "redirect", Path: "/", }) - http.Redirect(w, r, lang + "/", http.StatusMovedPermanently) + http.Redirect(w, r, url + lang + "/", http.StatusMovedPermanently) return } @@ -52,7 +52,7 @@ func router(w http.ResponseWriter, r *http.Request) { parts := strings.Split(path, "/") _, err = r.Cookie("redirect") - if isSupportedLanguage(parts[0]) { + if isSupportedLanguage(parts[0]) && parts[0] != lang { if r.Header.Get("Referer") == "" && err != nil { parts[0] = lang path = strings.Join(parts, "/") |