fix: avoid unsafe header buffer reuse

Use safe string copies for pooled header buffers and simplify case-insensitive lookup buffering now that the pseudo stack path was ineffective. This addresses review concerns without changing the routing semantics.
This commit is contained in:
wjqserver 2026-04-07 09:32:14 +08:00
parent 2d4aefc86e
commit 57847fa446
3 changed files with 4 additions and 13 deletions

View file

@ -709,7 +709,7 @@ func (p *reverseProxyHandler) writeLocalOptionsResponse(c *Context) {
allowHeader = append(allowHeader, method...)
}
c.allowHeaderBuf = allowHeader[:0]
c.Writer.Header().Set("Allow", BytesToString(allowHeader))
c.Writer.Header().Set("Allow", string(allowHeader))
}
}
}