Skip to content

Commit

Permalink
[revert] remove blocking country feature
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed Mar 11, 2024
1 parent b3a9a3d commit 9eaf3c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ async function handleRequest(request, env, ctx) {
}

async function handleNormalRequest(request, env, ctx) {
const country = request.headers.get("cf-ipcountry")
if (env.BLOCKED_COUNTRIES && country && env.BLOCKED_COUNTRIES.includes(country)) {
return new Response("Service is not available in your country", { status: 403 });
}

if (request.method === "POST") {
return await handlePostOrPut(request, env, ctx, false)
} else if (request.method === "GET") {
Expand Down
2 changes: 0 additions & 2 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ CACHE_STATIC_PAGE_AGE = 7200

# Cache-Control max-age for static pages
CACHE_PASTE_AGE = 600

BLOCKED_COUNTRIES = [ "IN" ]

0 comments on commit 9eaf3c8

Please sign in to comment.