Skip to content

Commit

Permalink
Merge pull request #249 from Synthetixio/staging
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
jmzwar authored Aug 16, 2023
2 parents eacd4ff + ab3ea7e commit 789b005
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
23 changes: 23 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { NextRequest } from 'next/server';
import { NextResponse, userAgent } from 'next/server';

// Set pathname were middleware will be executed
export const config = {
matcher: '/',
};

export function middleware(req: NextRequest) {
// Parse user agent
const ua = userAgent(req);

if (
ua.ua.includes('AdsBot-Google') ||
ua.ua.includes('Google-AdWords-Express')
) {
// Update the expected url
req.nextUrl.pathname = `_phishingprotection/index.html`;

// Return rewrited response
return NextResponse.rewrite(req.nextUrl);
}
}
14 changes: 14 additions & 0 deletions public/_phishingprotection/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<title>PHISHING SITE</title>
</head>
<body>
<h1 style="color: red; text-align: center">THIS IS A PHISHING SITE</h1>
<p>
If you are seeing this message, we <i>do not</i> use google ads. However,
this website is often targeted by scammers attempting to publish phishing
ads using our name.
</p>
<p>DO NOT APPROVE THIS AD.</p>
</body>
</html>
2 changes: 1 addition & 1 deletion src/sections/home/perps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Perps = () => {
Synthetix <GradientText>perpetual futures</GradientText> are a set of
composable and decentralized smart contracts{' '}
<GradientText>powering an ecosystem</GradientText> of derivatives
projects
projects.
</Text>
<Button
p="10px 16px"
Expand Down
6 changes: 3 additions & 3 deletions src/sections/home/volume.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Volume = ({
fontFamily="heading"
mb="16px"
>
TRADING VOLUME
TOTAL TRADING VOLUME
</Text>
<Heading
fontFamily="heading"
Expand All @@ -45,7 +45,7 @@ export const Volume = ({
fontSize={{ base: '44px', md: '90px' }}
color="gray.50"
>
{cumulativeTradingVolume}
${cumulativeTradingVolume}
</Heading>
</Flex>
<Flex flexDirection="column" mt="48px">
Expand All @@ -65,7 +65,7 @@ export const Volume = ({
fontSize={{ base: '44px', md: '90px' }}
color="gray.50"
>
{tvl}
${tvl}
</Heading>
</Flex>
</Flex>
Expand Down

1 comment on commit 789b005

@vercel
Copy link

@vercel vercel bot commented on 789b005 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.