From 382b9b174fe3db8a4cbbce2c8dd34e80fdaae30d Mon Sep 17 00:00:00 2001 From: ferhat elmas Date: Tue, 21 May 2024 12:09:25 +0200 Subject: [PATCH] fix: header cleanup replaced value should be trimmed, otherwise escape characters won't be handled correctly. --- header.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/header.go b/header.go index 3c94f7d..c78b9a7 100644 --- a/header.go +++ b/header.go @@ -100,7 +100,7 @@ func headerWriteSubset(h http.Header, exclude map[string]bool, writeHeader func( } for i, v := range kv.Values { vv := headerNewlineToSpace.Replace(v) - vv = textproto.TrimString(v) + vv = textproto.TrimString(vv) if vv != v { kv.Values[i] = vv }