Forum Discussion

DCL_SysAdmin's avatar
4 months ago
Solved

Is "CORS Preflight Request" supported?

Hello team,

Is the CORS preflight request is supported in cato api server?
When I query from browser by javascript, the preflight request was blocked by CORS policy.

ーーーーー
Access to XMLHttpRequest at 'https://api.catonetworks.com/api/v1/graphql2' from origin 'http://localhost:4000' 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.
ーーーーー

What I want to know is if this is normal behavior or a problem with my program.

 

Thank you,

  • Hello,

    I don't believe our API endpoint supports CORS. Most clients accessing the API aren't using a web browser to do so - they're using something like Terraform or Python - so the same-origin principle doesn't really apply to them.

  • peter's avatar
    peter
    Icon for Cato Employee rankCato Employee

    Hello,

    I don't believe our API endpoint supports CORS. Most clients accessing the API aren't using a web browser to do so - they're using something like Terraform or Python - so the same-origin principle doesn't really apply to them.

  • Hello peter,

    Thank you for your response.
    OK, so we have to plan query from server.

    Thank you,