mirror of
https://github.com/1f349/violet.git
synced 2024-12-26 01:06:25 +00:00
Close incoming request body in redirect anyway
This commit is contained in:
parent
78d930d32c
commit
ef5a15f5c3
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user