diff --git a/notify/pack_test.go b/notify/pack_test.go index e544481a..d59303a7 100644 --- a/notify/pack_test.go +++ b/notify/pack_test.go @@ -102,6 +102,35 @@ func TestTelegramPackingUsesRuneBudget(t *testing.T) { } } +// TestTelegramPackingCountsEscapedText covers digest lines that carry HTML +// metacharacters (an XSS title, a query string with &). They grow when escaped, +// so packing must measure the escaped text: every item reported as kept has to +// appear whole in the message, and the footer must survive. +func TestTelegramPackingCountsEscapedText(t *testing.T) { + m := batchMsg(200) + m.WindowMinutes = 60 + m.HomeURL = "https://artex.example.com/" + for i := range m.Items { + m.Items[i].Name = "Reflected XSS