Skip to content

Commit

Permalink
remove webflow badge
Browse files Browse the repository at this point in the history
  • Loading branch information
mlejva committed Dec 6, 2024
1 parent ff8f0ab commit 52b2583
Show file tree
Hide file tree
Showing 3 changed files with 5,464 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/web/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ export async function middleware(req: NextRequest): Promise<NextResponse> {

// !!! NOTE: Replace has intentionally not completed quotes to catch the rest of the path !!!
const modifiedHtmlBody = replaceUrls(htmlBody, url.pathname, 'href="', '">')
// Remove the script with cdn.prod.website-files.com hostname
const scriptRegex = /<script src="https:\/\/cdn\.prod\.website-files\.com\/[^\"]*\.js" type="text\/javascript"><\/script>/g
const cleanedHtmlBody = modifiedHtmlBody.replace(scriptRegex, '')

return new NextResponse(modifiedHtmlBody, {
return new NextResponse(cleanedHtmlBody, {
status: res.status,
statusText: res.statusText,
headers: res.headers,
Expand Down
Loading

0 comments on commit 52b2583

Please sign in to comment.