Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS not working - Question really #106

Open
nimeso opened this issue Oct 3, 2019 · 1 comment
Open

CORS not working - Question really #106

nimeso opened this issue Oct 3, 2019 · 1 comment

Comments

@nimeso
Copy link

nimeso commented Oct 3, 2019

I have the following domains:
http://app.arvrlab.org.nz (the origin domain requesting from the API)
http://cms.arvrlab.org.nz (the Silverstripe CMS and API)

I get the following CORS errors:

Access to XMLHttpRequest at 'http://cms.arvrlab.org.nz/api/Member/743' from origin 'http://app.arvrlab.org.nz' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

My config yml looks like:

RESTfulAPI:
  authentication_policy: true
  dependencies:
    authenticator: '%$RESTfulAPI_TokenAuthenticator'
  embedded_records:
    'Quest':
      - 'Tasks'
    'Member':
      - 'AraCourses'
  cors:
    Enabled: true
    Allow-Origin: 'http://app.arvrlab.org.nz'
    Allow-Headers: '*'
    Allow-Methods: 'OPTIONS, GET, PUT, POST, PATCH, DELETE'
    Max-Age: 86400

I've tried:

RESTfulAPI:
  authentication_policy: true
  dependencies:
    authenticator: '%$RESTfulAPI_TokenAuthenticator'
  embedded_records:
    'Quest':
      - 'Tasks'
    'Member':
      - 'AraCourses'
  cors:
    Enabled: true
    Allow-Origin: '*'
    Allow-Headers: '*'
    Allow-Methods: 'OPTIONS, GET, PUT, POST, PATCH, DELETE'
    Max-Age: 86400

As well (dev/build) done each time. But still having no luck at all?

Any ideas? Sorry, I'm not the best dev on the block so maybe I'm just missing something simple?

Cheers
Jamie

@thats4shaw
Copy link

Did you get to the bottom of this @nimeso?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants