corydolphin / flask-cors

Cross Origin Resource Sharing ( CORS ) support for Flask
https://flask-cors.corydolphin.com/
MIT License
877 stars 137 forks source link

When Used before_request Decorator in the main file , it raises origin policy error #242

Closed shivamguys closed 5 years ago

shivamguys commented 5 years ago

Screenshot from 2019-04-28 01-36-22 Screenshot from 2019-04-28 01-34-19 Screenshot from 2019-04-28 01-33-46

When I am using the decorator in the main file it raises me an error while everything works fine without using that.

shivamguys commented 5 years ago

Just Add a cross_origin() decorator below to that it works like a charm,but then issue is that before_each decorator needs to return some response although it's not supposed to return any response but using a cross origin decorator just mimics the cross origin and it makes it as a normal function that should return some response. Screenshot from 2019-04-28 02-58-38

Error SS Below Screenshot from 2019-04-28 03-01-58