From 7d483ff3ef1b1879982e5325ab68e5e48547c5cf Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Thu, 17 Oct 2024 15:58:53 +0800 Subject: [PATCH] set temp file limiter for buffered body --- modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go index 1be13d27..592f2656 100644 --- a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go +++ b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go @@ -239,6 +239,7 @@ func (t Transport) bufferBody(req io.Reader) (int64, io.ReadCloser, error) { size, err := io.CopyN(memBuf, req, t.BodyBufferMemoryLimit) var body bufferedBody // should be closed in case buffering fails body.memBuf = memBuf + body.tempFileLimiter = t.tempFileLimiter // error while reading the body if err != nil { // fully buffered in memory