From baa4a5b434c7f5e4edbf0876e387352efb71027f Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Tue, 27 Feb 2024 11:42:07 +0000 Subject: [PATCH 1/2] close-airdrop --- frontend/middleware.js | 50 +++++++++--------------------------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/frontend/middleware.js b/frontend/middleware.js index c7286f93..94770993 100644 --- a/frontend/middleware.js +++ b/frontend/middleware.js @@ -1,36 +1,10 @@ -import { NextResponse } from 'next/server' - -// Block visitors from these countries -const BLOCKED_COUNTRIES = [ - 'BY', - 'CF', - 'CD', - 'KP', - 'CU', - 'IR', - 'LY', - 'SO', - 'SD', - 'SY', - 'US', - 'GB', - 'YE', - 'ZW', -] - // Limit middleware pathname config export const config = { matcher: '/', } export function middleware(req) { - // Extract country - const country = req.geo.country - - if (BLOCKED_COUNTRIES.includes(country)) { - // Error 451: Unavailable For Legal Reasons - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451 - const body = ` + const body = ` -

Error 451: Unavailable For Legal Reasons

-

This Site is not available to residents of Belarus, the Central African Republic, The Democratic Republic of Congo, the Democratic People's Republic of Korea, the Crimea, Donetsk People's Republic, and Luhansk People's Republic regions of Ukraine, Cuba, Iran, Libya, Somalia, Sudan, South Sudan, Syria, the USA, the United Kingdom, Yemen, Zimbabwe and any other jurisdiction in which accessing or using the Site is prohibited (the "Prohibited Jurisdictions").

+

The airdrop claim period has ended

+

To stay in touch with future Pyth community initiatives head over to our Discord

` - // NextResponse object does not have a body property so we use Response instead - return new Response(body, { - status: 451, - headers: { - 'Content-Type': 'text/html', - }, - }) - } else { - // Continue with the request if the country is not blocked - return NextResponse.next() - } + // NextResponse object does not have a body property so we use Response instead + return new Response(body, { + status: 200, + headers: { + 'Content-Type': 'text/html', + }, + }) } From 7410a208938a99afb9324d22e4145a129473ffe9 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Fri, 15 Mar 2024 11:48:47 +0000 Subject: [PATCH 2/2] Go --- .../programs/token-dispenser/src/ecosystems/aptos.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token-dispenser/programs/token-dispenser/src/ecosystems/aptos.rs b/token-dispenser/programs/token-dispenser/src/ecosystems/aptos.rs index 15a4759d..53cab51e 100644 --- a/token-dispenser/programs/token-dispenser/src/ecosystems/aptos.rs +++ b/token-dispenser/programs/token-dispenser/src/ecosystems/aptos.rs @@ -21,7 +21,7 @@ pub const APTOS_SIGNATURE_SCHEME_ID: u8 = 0; /** * An arbitrary signed message used in Aptos. * Only the message payload is stored in this struct. -* The message signed for Aptos is the payload prefixed with APTOS_PREFIX and suffixed with APTOS_SUFFIX. +* For Aptos, the message signed is the payload prefixed with APTOS_PREFIX and suffixed with APTOS_SUFFIX. */ #[derive(AnchorDeserialize, AnchorSerialize, Clone)]