Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
How to detect geo blocking in a browser

How to detect whether or not a user or resource is being geo-blocked?

Given
  • Two AWS CloudFront Distributions:
    • Website at www.example.com
    • 2nd domain at videos.example.com which is geo-restricted/blocked via CloudFront geo restriction
  • CORS is working, it is possible to execute requests from the website towards the video CDN if user is not geo blocked
  • When a user accesses the video CDN he'll see http/403 Forbidden or http/200 OK depending on this geo location.
Problem

A geo blocked user cannot probe resources from the restricted CDN and check the return code being either http/200 OK or http/403 Forbidden:

Since the requests originates from www. and then send towards a different domain video. it is a different domain so the browser must send a CORS/preflight requests. But this request will be blocked due to the geo restriction.

From JavaScript perspective it simply fails the CORS preflight with no error details.

I tried fetching different ContentTypes in combination with fetch mode: cors/no-cors that would qualify for a Simple Request and thus not require CORS — but no success so far.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!