accept .redir=true

This commit is contained in:
bel
2026-06-20 20:28:03 -06:00
parent 9189b97277
commit 96052b786d
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@ type (
Endpoint struct {
To string
Redir bool
BasicAuth string
}
)
+5
View File
@@ -39,6 +39,11 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
if endpoint.Redir {
http.Redirect(w, r, r.URL.String(), http.StatusSeeOther)
return
}
cors(w)
if r.Method == http.MethodOptions {
w.Header().Set("Content-Length", "0")