andrewperlas / gcp-resume

Cloud resume challenge hosted on GCP
0 stars 0 forks source link

Access to fetch Cloud Function from resume website is blocked by CORS policy #13

Closed andrewperlas closed 2 months ago

andrewperlas commented 2 months ago

Error message in console when loading resume website:

No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

No new entry is added to the Firestore database.

andrewperlas commented 2 months ago

The CORS headers for the main request required the addition of the Access-Control-Allow-Methods and Access-Control-Allow-Headers lines.

https://github.com/andrewperlas/gcp-resume/blob/cffb1029a6e711e025adeabdc580715405fd91de/functions/main.py#L28-L37

Visits to https://resume.andrewperlas.com are now registering new entries into the database.