internal: limit body size

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-10-17 18:52:12 +02:00
parent ddc23c6d88
commit 56181a45a1
1 changed files with 1 additions and 0 deletions

View File

@ -61,6 +61,7 @@ func (ws *WebServer) configureProxy() {
Requests.With(prometheus.Labels{
"dest": "py",
}).Observe(float64(time.Since(before)))
r.Body = http.MaxBytesReader(rw, r.Body, 32*1024*1024)
rp.ServeHTTP(rw, r)
}))
}