Skip to content

Commit

Permalink
pass eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
boutell committed Jan 26, 2021
1 parent 54851d0 commit 1ecf30f
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,54 +1272,54 @@ describe('sanitizeHtml', function() {
it('Should prevent hostname bypass using protocol-relative src', function () {
assert.strictEqual(
sanitizeHtml('<iframe src="/\\example.com"></iframe>', {
allowedTags: ['iframe'],
allowedTags: [ 'iframe' ],
allowedAttributes: {
iframe: ['src']
iframe: [ 'src' ]
},
allowedIframeHostnames: ["www.youtube.com"],
allowedIframeHostnames: [ 'www.youtube.com' ],
allowIframeRelativeUrls: true
}), '<iframe></iframe>'
);
assert.strictEqual(
sanitizeHtml('<iframe src="\\/example.com"></iframe>', {
allowedTags: ['iframe'],
allowedTags: [ 'iframe' ],
allowedAttributes: {
iframe: ['src']
iframe: [ 'src' ]
},
allowedIframeHostnames: ["www.youtube.com"],
allowedIframeHostnames: [ 'www.youtube.com' ],
allowIframeRelativeUrls: true
}), '<iframe></iframe>'
);
const linefeed = decodeURIComponent("%0A");
const linefeed = decodeURIComponent('%0A');
assert.strictEqual(
sanitizeHtml('<iframe src="/'+linefeed+'\\example.com"></iframe>', {
allowedTags: ['iframe'],
sanitizeHtml('<iframe src="/' + linefeed + '\\example.com"></iframe>', {
allowedTags: [ 'iframe' ],
allowedAttributes: {
iframe: ['src']
iframe: [ 'src' ]
},
allowedIframeHostnames: ["www.youtube.com"],
allowedIframeHostnames: [ 'www.youtube.com' ],
allowIframeRelativeUrls: true
}), '<iframe></iframe>'
);
const creturn = decodeURIComponent("%0D");
const creturn = decodeURIComponent('%0D');
assert.strictEqual(
sanitizeHtml('<iframe src="/'+creturn+'\\example.com"></iframe>', {
allowedTags: ['iframe'],
sanitizeHtml('<iframe src="/' + creturn + '\\example.com"></iframe>', {
allowedTags: [ 'iframe' ],
allowedAttributes: {
iframe: ['src']
iframe: [ 'src' ]
},
allowedIframeHostnames: ["www.youtube.com"],
allowedIframeHostnames: [ 'www.youtube.com' ],
allowIframeRelativeUrls: true
}), '<iframe></iframe>'
);
const tab = decodeURIComponent("%09");
const tab = decodeURIComponent('%09');
assert.strictEqual(
sanitizeHtml('<iframe src="/'+tab+'\\example.com"></iframe>', {
allowedTags: ['iframe'],
sanitizeHtml('<iframe src="/' + tab + '\\example.com"></iframe>', {
allowedTags: [ 'iframe' ],
allowedAttributes: {
iframe: ['src']
iframe: [ 'src' ]
},
allowedIframeHostnames: ["www.youtube.com"],
allowedIframeHostnames: [ 'www.youtube.com' ],
allowIframeRelativeUrls: true
}), '<iframe></iframe>'
);
Expand Down

0 comments on commit 1ecf30f

Please sign in to comment.