Web Connection
CORS problem
Gravatar is a globally recognized avatar based on your email address. CORS problem
  Michele
  All
  Mar 14, 2024 @ 04:13am

While using my REST service, i have this error when trying to use it

Access to XMLHttpRequest at 'http://cloud1.acut.it:8090/do.acr?cmd=newsession' from origin 'http://localhost:9000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

If i test my REST on some online tools i have no problem, with others it doesn't work

Suggests?

Thanks

Gravatar is a globally recognized avatar based on your email address. re: CORS problem
  Rick Strahl
  Michele
  Mar 14, 2024 @ 09:38am

Anything generated from another browser and going across domains requires CORS which is a browser HTTP client policy tool that checks for the CORS policy. If you're testing from a non-browser tool (like WebSurge or Postman) then CORS isn't required because it's not a browser doing the request.

You can add CORS support in your process class and OnProcessInit():

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: CORS problem
  Michele
  Rick Strahl
  Mar 16, 2024 @ 07:42am

Solved with code you suggested

Thanks

© 1996-2024