-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1211 from interlay/tom/release/interlay/2.31.3
[release] Interlay 2.31.3
- Loading branch information
Showing
4 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export const config = { | ||
runtime: 'edge', | ||
}; | ||
|
||
const blockedCountries = [ | ||
'AL', | ||
'BS', | ||
'BB', | ||
'BW', | ||
'KH', | ||
'KP', | ||
'GH', | ||
'JM', | ||
'MY', | ||
'MU', | ||
'MM', | ||
'NI', | ||
'ID', | ||
'IR', | ||
'AF', | ||
'PK', | ||
'CN', | ||
'PA', | ||
'AM', | ||
'GN', | ||
'IQ', | ||
'RW', | ||
'RS', | ||
'SY', | ||
'TH', | ||
'UG', | ||
'TZ', | ||
'US', | ||
'YE', | ||
'ZW' | ||
]; | ||
|
||
function isGeoblocked(req) { | ||
// https://vercel.com/docs/concepts/edge-network/headers#x-vercel-ip-country | ||
const countryCode = req.headers.get('x-vercel-ip-country') | ||
return blockedCountries.includes(countryCode) | ||
} | ||
|
||
export default (req) => { | ||
return new Response(null, { status: isGeoblocked(req) ? 403 : 200 }) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b4ad444
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
interbtc-ui-interlay – ./
interbtc-ui-interlay-git-interlay-interlay.vercel.app
app.interlay.io
interbtc-ui-interlay.vercel.app
interbtc-ui-interlay-interlay.vercel.app