Skip to content

Commit

Permalink
Ensure dangerouslyAllowSVG is passed correctly (#39031)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jul 26, 2022
1 parent fd7bd12 commit cee2cf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1571,6 +1571,7 @@ export default async function getBaseWebpackConfig(
imageSizes: config.images.imageSizes,
path: config.images.path,
loader: config.images.loader,
dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,
experimentalUnoptimized: config?.experimental?.images?.unoptimized,
experimentalFuture: config.experimental?.images?.allowFutureImage,
...(dev
Expand Down
5 changes: 2 additions & 3 deletions test/integration/production/test/security.js
Expand Up @@ -321,9 +321,8 @@ module.exports = (context) => {
try {
browser = await webdriver(context.appPort, '/svg-image')
await browser.eval(`document.getElementById("img").scrollIntoView()`)
expect(
await browser.elementById('img').getAttribute('src')
).toContain('xss.svg')
const src = await browser.elementById('img').getAttribute('src')
expect(src).toMatch(/_next\/image\?.*xss\.svg/)
expect(await browser.elementById('msg').text()).toBe('safe')
browser = await webdriver(
context.appPort,
Expand Down

0 comments on commit cee2cf3

Please sign in to comment.