ActoKids / AD440_W19_CloudPracticum

3 stars 1 forks source link

BUG: No 'Access-Controll-Allow-Origin'... #107

Closed erikNeville closed 5 years ago

erikNeville commented 5 years ago

Issue with access control due to the header being present on the requested resource.

I am trying to use the event_id, which is generated through AWS, as a way to pass props to another react Component, and I am receiving this error: No 'Access-Control-Allow-Origin' header is present on the requested resource

Here is a shot of there being no issues with CORS headers on our dashboard: working-api-dashboard

And a shot of the error I get when I try to use the ID in a header: network-error

A link I've been reading through to understand this issue: https://serverless-stack.com/chapters/handle-api-gateway-cors-errors.html

erikNeville commented 5 years ago

For further understanding of what I'm trying to do, here is my commit for the code I have so far: https://github.com/ActoKids/web-ui/pull/34/commits/f6f3911b14cbc165b7f457f4bd27c33ccd3497a7

Enshaedn commented 5 years ago

I think the error is in your URL / endpoint call. I've marked the line in your code with a comment, but essentially it looks like you're trying to call /v1/event/{event_id}, but that is not a valid endpoint. The endpoint is /v1/events/{event_id}.

Presuming you're just trying to GET by id: image

That is the same event_id and it works as a GET.