Datasource error in AppGyver "Access-Control-Allow-Origin", same call works everywhere else

I’m trying to access an api internal to our company. It’s a simple GET call to a Firebase function - no authentication, no special headers, just two parameters passed in the URL. Works fine from Postman. Works fine in

When I try to setup as a datasource here and test via GET (ONE), I get the following error:

“Error: TypeError: Origin is not allowed by Access-Control-Allow-Origin.”

When I try to access as a simple HTTP request workflow, I get this error: “Unknown error occured while making the GET request”.

Any ideas? Not much I can see from here.

I should add that the call to our API is running fine. Server log shows return of Status 200OK. The breakdown is somewhere on the Appgyver side.

The difference is that Composer makes the request directly from the browser, which means Cross-Origin Resource Sharing rules apply, and if the correct headers are not in place on the server the API call is made to, the browser’s native security settings do not allow the response to be processed.

Postman, cURL and other non-browser ways of making a direct HTTP call do not have this issue, and I assume Bubble pipes the request through a hosted Backend-as-a-Service component.

Furthermore, Composer-built web apps are statically deployed and make API calls directly to the integrated APIs without an AppGyver-hosted backend inbetween, so before we are able to provide our backend-as-a-service product, the issue needs to be fixed on the target backend.

To fix this, see e.g. (first result for “firebase enable cors”).

Thanks for the help, @Harri_Sarsa. I can make the exact same call from url box in Safari & Chrome (both in private/anonymous mode) and it returns no problem. I’ll DM you the url if you can take a look.

Directly inputting the URL into the address box works also – the CORS rules go into effect if a website makes the call via JavaScript.

Thanks for all the help - that got me going.

1 Like

Can you please share how did you solve it?

1 Like

Any help on this Error? "AppGyver “Access-Control-Allow-Origin”. I can’t seem to run test.