Close incoming request body in redirect anyway

This commit is contained in:
Melon 2023-09-10 15:20:51 +01:00
parent 78d930d32c
commit ef5a15f5c3
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -60,6 +60,11 @@ func (r Redirect) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
Path: p,
}
// close the incoming body after use
if req.Body != nil {
defer req.Body.Close()
}
// use fast redirect for speed
utils.FastRedirect(rw, req, u.String(), code)
}