docs: update comments for shouldRewriteUA

This commit is contained in:
SunBK201 2025-11-23 14:05:22 +08:00
parent 0b011ca992
commit 43d95183d9

View File

@ -15,10 +15,8 @@ type RewriteResult struct {
InCache bool // Whether destination address is in cache InCache bool // Whether destination address is in cache
} }
// shouldRewriteUA checks if the given User-Agent should be rewritten // shouldRewriteUA determines if the User-Agent should be rewritten
// Returns true if UA should be rewritten (not in whitelist and matches regex pattern)
func (r *Rewriter) shouldRewriteUA(srcAddr, dstAddr string, ua string) bool { func (r *Rewriter) shouldRewriteUA(srcAddr, dstAddr string, ua string) bool {
// If no pattern specified, rewrite all non-whitelist UAs
if r.pattern == "" { if r.pattern == "" {
return true return true
} }