Google API not recognizing allowed domain

Hi there, everyone,

I’m trying to build a membermap and am having a problem with Google’s api restriction system. I’ve told it to allow the domain:

But when I try the map at https://aircooledaddiction.com/test.html , the map fails to load and the javascript console reports:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true. (Reason: CORS request did not succeed). Status code: (null).

Google Maps JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://aircooledaddiction.com/test.html

What am I doing wrong? I followed the Google API doc for creating the project, adding the restriction and enabling javascript embed.

Any help would be greatly appreciated. Thanks for your time!

To allow cors, you normally have some requirements on the headers you send to the server as well.

Mostly you need to send at minimum your Origin.

I would suggest to use PostMan to first check the connection to the API and after it works in this tool, you can start to implement it in your Website.

https://aircooledaddiction.com/test.html

does not match *.aircooledaddiction.com/*

Look closely at the beginning…

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.