mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 01:16:46 +00:00
sanitzie XML characters
This commit is contained in:
parent
9d56a3bd35
commit
551e2a2770
3 changed files with 41 additions and 6 deletions
|
@ -82,4 +82,22 @@ describe('auth tests', () => {
|
|||
expect(fs.existsSync(m2Dir)).toBe(false);
|
||||
expect(fs.existsSync(settingsFile)).toBe(false);
|
||||
}, 100000);
|
||||
|
||||
it('escapes invalid XML inputs', () => {
|
||||
const id = 'packages';
|
||||
const username = 'bluebottle';
|
||||
const password = '&<>"\'\'"><&';
|
||||
|
||||
expect(auth.generate(id, username, password)).toEqual(`
|
||||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>${id}</id>
|
||||
<username>${username}</username>
|
||||
<password>&<>"''"><&</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue