We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79f970e commit 547333fCopy full SHA for 547333f
src/audits/render.ts
@@ -119,11 +119,10 @@ async function printAuditFail(result: AuditFail) {
119
json = JSON.parse(text);
120
// is json, there shouldnt be nothing to sanitize (hopefully)
121
} catch {
122
- // is not json, sanitize probably html
123
- text.replace(
124
- /data-cf-beacon=('.*?'|".*?")/gm,
125
- 'data-cf-beacon="<omitted>"',
126
- );
+ // is not json, avoid rendering html (rest is allowed)
+ if (res.headers.get('content-type')?.includes('text/html')) {
+ text = '<html omitted>';
+ }
127
}
128
const stringified = JSON.stringify(
129
{
0 commit comments