This commit is contained in:
Geometrically 2023-05-08 19:01:06 -07:00 committed by GitHub
parent 732f88ff51
commit 82b96d1a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 849 additions and 620 deletions

View File

@ -14,16 +14,11 @@ export const configuredXss = new xss.FilterXSS({
kbd: ['id'],
input: ['checked', 'disabled', 'type'],
iframe: ['width', 'height', 'allowfullscreen', 'frameborder', 'start', 'end'],
img: [...xss.whiteList.img, 'style', 'usemap'],
img: [...xss.whiteList.img, 'usemap'],
map: ['name'],
area: [...xss.whiteList.a, 'coords'],
a: [...xss.whiteList.a, 'rel'],
},
css: {
whiteList: {
'image-rendering': /^pixelated$/,
},
},
onIgnoreTagAttr: (tag, name, value) => {
// Allow iframes from acceptable sources
if (tag === 'iframe' && name === 'src') {
@ -80,7 +75,7 @@ export const configuredXss = new xss.FilterXSS({
]
if (!allowedHostnames.includes(url.hostname)) {
return `https://wsrv.nl/?url=${encodeURIComponent(value)}`
return `https://wsrv.nl/?url=${encodeURIComponent(value)}&n=-1`
}
} catch (err) {}
}

1460
yarn.lock

File diff suppressed because it is too large Load Diff