Ask coding questions

← Back to all posts
CORS blocking request when using custom domain.
xfinnbar (21)
Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The error only appears when using my custom domain,, instead of the one

Answered by Coder100 (17018) [earned 5 cycles]
View Answer
Coder100 (17018)

add this to ur code like:

from flask import Flask
from flask_cors import CORS

app = Flask(__name__)

def helloWorld():


so easy

xxpertHacker (861)

Just send COORS HTTP headers.