OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

CORS inconsistent behaviour [closed]

  • Thread starter Thread starter Amiya Lahiri
  • Start date Start date
A

Amiya Lahiri

Guest
I have created two simple flask servers for server testing purpose. I am taking two user inputs using html and sending it to first flask route and the response of the api, I am sending to another flask app route. I am using jquery and ajax for handling the request and response. However, when I am sending my first flask response to the other flask route it is showing CORS error.

Access to XMLHttpRequest at 'http://127.0.0.1:3000/start_video_prediction' from origin 'http://0.0.0.0:5000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local.

But the interesting fact is I have used flask-cors library and append the line CORS(app) which should act as CORS for all the routes in both the flask servers and for some inputs it is not blocking the request and for some inputs it is showing inconsistent behaviour. The headers are same for both the requests. can anyone please explain why I am getting this inconsistent behaviour of CORS.
<p>I have created two simple flask servers for server testing purpose.
I am taking two user inputs using html and sending it to first flask route and the response of the api, I am sending to another flask app route. I am using jquery and ajax for handling the request and response. However, when I am sending my first flask response to the other flask route
it is showing CORS error.</p>
<blockquote>
<p>Access to XMLHttpRequest at 'http://127.0.0.1:3000/start_video_prediction' from origin 'http://0.0.0.0:5000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space <code>local</code>.</p>
</blockquote>
<p>But the interesting fact is I have used flask-cors library and append the line
<strong>CORS(app)</strong> which should act as CORS for all the routes in both the flask servers and
for some inputs it is not blocking the request and for some inputs it is showing inconsistent behaviour. The headers are same for both the requests.
can anyone please explain why I am getting this inconsistent behaviour of CORS.</p>
 

Latest posts

A
Replies
0
Views
1
Aarif Hussain A Nassar
A
F
Replies
0
Views
1
Fahmi Nur Fachrurozi
F
Top