From 700c75e12e6cad04b3e765b6dc8dab15fd2020fe Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Fri, 16 Sep 2022 23:13:02 -0400 Subject: [PATCH] rename html integrity re to general as this replaces both html and javascript integrity tags in certain cases --- packages/proxy/lib/http/util/regex-rewriter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/proxy/lib/http/util/regex-rewriter.ts b/packages/proxy/lib/http/util/regex-rewriter.ts index f7c57fbc50ed..d8ff4550ac54 100644 --- a/packages/proxy/lib/http/util/regex-rewriter.ts +++ b/packages/proxy/lib/http/util/regex-rewriter.ts @@ -27,7 +27,7 @@ const javaScriptIntegrityReplacementRe = new RegExp(`[\\.](${STRIPPED_INTEGRITY_ * but the match only starts at the word integrity, and not the character preceding it. In these cases, we always replace the word integrity with cypress-stripped-integrity. * The match for cypress-stripped-integrity is if we are replacing in the stripStream, and the replaced text is rematched no essentially complete a no op */ -const htmlIntegrityReplacementRe = new RegExp(`(?:(? = { modifyObstructiveThirdPartyCode: false, @@ -41,7 +41,7 @@ export function strip (html: string, { modifyObstructiveThirdPartyCode }: Partia if (modifyObstructiveThirdPartyCode) { rewrittenHTML = rewrittenHTML.replace(javaScriptIntegrityReplacementRe, `['${STRIPPED_INTEGRITY_TAG}']$2`) - rewrittenHTML = rewrittenHTML.replace(htmlIntegrityReplacementRe, `${STRIPPED_INTEGRITY_TAG}$3`) + rewrittenHTML = rewrittenHTML.replace(generalIntegrityReplacementRe, `${STRIPPED_INTEGRITY_TAG}$3`) } return rewrittenHTML @@ -61,7 +61,7 @@ export function stripStream ({ modifyObstructiveThirdPartyCode }: Partial