providers/http: Make redirect function better

This commit is contained in:
Sasha Koshka 2024-12-10 21:32:50 -05:00
parent efc3fc0990
commit 79ac18c8c3

View File

@ -45,11 +45,11 @@ func funcError (status int, message any) (string, error) {
}
}
func funcRedirect (res shttp.WrappedResponseWriter, status int, pat string) (string, error) {
// TODO remove parameters
res.Header.Add("Location", pat)
res.WriteHeader(status)
return "", step.ErrExecutionCanceled
func funcRedirect (status int, pat string) (string, error) {
return "", shttp.Redirect {
Status: status,
Location: pat,
}
}
func funcParseForm (req *http.Request) url.Values {