B4J Question CORS error. Response to preflight request doesn't pass access control check: It does not have HTTP ok status

coldflame

Member
Good Afternoon Everyone,
Am working on a project using B4J and Nuxt JS. And I encountered a CORs error. I checked the forum and found https://www.b4x.com/android/forum/threads/banano-b4j-the-dreaded-cors-exception-solved.141890/#post-899673. However I am still getting the CORs error(Some request go through successfully). Here are some attached screenshots for context

This is the B4J Code

This request goes the server successfully


This request fails for the CORs check

This is the log from the console for the failed request


Please Help
Thanks.
 

alwaysbusy

Expert
Licensed User
Longtime User
I suppose you have also done the first part from that post, that is using a CORS filter. We had a similar thing a couple of weeks ago on our DEV server and we had to change this line to explicitly mention all the domains instead of using "*".

B4X:
' ConfigureCORS(srvr, "/*", "*", "*", "*") ' did not work anymore
' to:
ConfigureCORS(srvr, "https://api.wittouck.eu,https://work.wittouck.eu,http://localhost", "*", "*", "*")

Alwaysbusy
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…