From d3956337493bf4b63cb36bd8d510d7ed341447d6 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Thu, 17 Oct 2024 15:50:24 +0800 Subject: [PATCH] fix caddyfile parsing for php_fastcgi --- modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go index 6ff7beaf..82866f4e 100644 --- a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go @@ -330,6 +330,8 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error fcgiTransport.CaptureStderr = true case "body_buffer_disabled": + args := dispenser.RemainingArgs() + dispenser.DeleteN(len(args) + 1) fcgiTransport.BodyBufferDisabled = true case "body_buffer_memory_limit": @@ -341,6 +343,7 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error return nil, dispenser.Errf("bad buffer size %s: %v", dispenser.Val(), err) } fcgiTransport.BodyBufferMemoryLimit = int64(size) + dispenser.DeleteN(2) case "file_buffer_size_limit": if !dispenser.NextArg() { @@ -351,12 +354,14 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error return nil, dispenser.Errf("bad buffer size %s: %v", dispenser.Val(), err) } fcgiTransport.FileBufferSizeLimit = int64(size) + dispenser.DeleteN(2) case "file_buffer_filepath": if !dispenser.NextArg() { return nil, dispenser.ArgErr() } fcgiTransport.FileBufferFilepath = dispenser.Val() + dispenser.DeleteN(2) } } }