prevent unsafe replacements of preloaded data etc

This commit is contained in:
Rich Harris
2018-07-14 20:56:05 -04:00
parent 0e3775397f
commit 74acf93c7a
3 changed files with 24 additions and 5 deletions

View File

@@ -619,6 +619,16 @@ function run({ mode, basepath = '' }) {
assert.equal(name, 'BODY');
});
});
it('replaces %sapper.xxx% tags safely', () => {
return nightmare
.goto(`${base}/unsafe-replacement`)
.init()
.page.html()
.then(html => {
assert.equal(html.indexOf('%sapper'), -1);
});
});
});
describe('headers', () => {