accept .redir=true
This commit is contained in:
@@ -22,6 +22,7 @@ type (
|
|||||||
|
|
||||||
Endpoint struct {
|
Endpoint struct {
|
||||||
To string
|
To string
|
||||||
|
Redir bool
|
||||||
BasicAuth string
|
BasicAuth string
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if endpoint.Redir {
|
||||||
|
http.Redirect(w, r, r.URL.String(), http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
cors(w)
|
cors(w)
|
||||||
if r.Method == http.MethodOptions {
|
if r.Method == http.MethodOptions {
|
||||||
w.Header().Set("Content-Length", "0")
|
w.Header().Set("Content-Length", "0")
|
||||||
|
|||||||
Reference in New Issue
Block a user