fix(access_logger): nil panic when stdout only, improve concurrency safety

This commit is contained in:
yusing
2025-11-01 01:17:55 +08:00
parent 77e486f4fe
commit e670acb4b8
11 changed files with 207 additions and 117 deletions

View File

@@ -52,10 +52,7 @@ func ValidateVars(s string) error {
func ExpandVars(w *ResponseModifier, req *http.Request, src string, dstW io.Writer) error {
dst := ioutils.NewBufferedWriter(dstW, 1024)
defer func() {
dst.Flush()
dst.Release()
}()
defer dst.Close()
for i := 0; i < len(src); i++ {
ch := src[i]