Source code

Revision control

Copy as Markdown

Other Tools

function addNoVarySearchHeaderUsingPipe(searchParams, headerValue) {
// Use server pipes
// No-Vary-Search response header. The "," and ")" characters need to be
// escaped by using backslash (see
// params=("a") becomes params=("a"\), params=("a"),key-order becomes
// params=("a"\)\,key-order etc.
searchParams.append(
'pipe',
`header(No-Vary-Search,${headerValue.replaceAll(/[,)]/g, '\\$&')})`);
}