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")