From 96052b786d779a5eb4e43e517d42ee14b75b8dc9 Mon Sep 17 00:00:00 2001 From: bel Date: Sat, 20 Jun 2026 20:28:03 -0600 Subject: [PATCH] accept .redir=true --- config.go | 1 + main.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/config.go b/config.go index 25f0ef6..09a78bd 100644 --- a/config.go +++ b/config.go @@ -22,6 +22,7 @@ type ( Endpoint struct { To string + Redir bool BasicAuth string } ) diff --git a/main.go b/main.go index 19f9d14..ae4d1e6 100644 --- a/main.go +++ b/main.go @@ -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")