fix(web): satisfy staticcheck policy checks
CI / validate (pull_request) Successful in 21m2s

This commit is contained in:
2026-08-12 23:50:54 +02:00
parent 26ce216246
commit 559dcde2eb
2 changed files with 1 additions and 8 deletions
-7
View File
@@ -2,8 +2,6 @@ package web
import (
"net/http"
"net/url"
"strings"
"time"
"git.zaynet.fr/DoGaMa/DoGaMa-serv/internal/webaccess"
@@ -116,8 +114,3 @@ func (s *server) languageSelect(w http.ResponseWriter, r *http.Request) {
s.setCookie(w, r, languageCookie, language, time.Now().Add(365*24*time.Hour), true)
http.Redirect(w, r, target, http.StatusSeeOther)
}
func canonicalURL(value string) *url.URL { u, _ := url.Parse(value); return u }
func canonicalMatches(r *http.Request, canonical string) bool {
return strings.TrimSuffix(requestBaseURL(r), "/") == strings.TrimSuffix(canonical, "/")
}
+1 -1
View File
@@ -44,7 +44,7 @@ func (p Policy) Validate() (Policy, error) {
return Policy{}, err
}
if p.RequireHTTPS && canonical != "" && !strings.HasPrefix(canonical, "https://") {
return Policy{}, errors.New("Require HTTPS requires an HTTPS canonical base URL")
return Policy{}, errors.New("require HTTPS requires an HTTPS canonical base URL")
}
p.CanonicalURL = canonical
return p, nil