// The second URL is also filtered.
`<img srcset="/not-an-image#,#ZgotmplZ">`,
},
+ {
+ "srcset buffer growth",
+ `<img srcset={{",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}}>`,
+ `<img srcset=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,>`,
+ },
}
for _, test := range tests {
// processURLOnto appends a normalized URL corresponding to its input to b
// and returns true if the appended content differs from s.
func processURLOnto(s string, norm bool, b *bytes.Buffer) bool {
- b.Grow(b.Cap() + len(s) + 16)
+ b.Grow(len(s) + 16)
written := 0
// The byte loop below assumes that all URLs use UTF-8 as the
// content-encoding. This is similar to the URI to IRI encoding scheme