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

Add CORS headers so QA API can be used from JavaScript from another origin #3

Closed
zimeon opened this issue Aug 17, 2018 · 3 comments
Closed
Assignees
Labels
qa configs work needs to happen at the qa config level qa feature requires code change

Comments

@zimeon
Copy link
Member

zimeon commented Aug 17, 2018

The key requirements are:

  1. to add the following HTTP header to responses to GET, where * indicates that code from any origin should be able to read data from QA.:
Access-Control-Allow-Origin: *
  1. to support the OPTIONS HTTP method on the same resource, for which I think can be just the addition of the HTTP methods supported, perhaps a 204 with headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, OPTIONS

See http://www.w3.org/TR/cors/ for gory details, https://fetch.spec.whatwg.org/#cors-protocol for more a intelligible descriptions.

Examples in Ruby in RIIF -- add ACAO and adding support for OPTIONS (which in this case allows the Authorization header, not needed for QA I assume).

@zimeon zimeon added Lookup qa configs work needs to happen at the qa config level to do and removed Lookup qa configs work needs to happen at the qa config level labels Aug 17, 2018
@elrayle
Copy link
Member

elrayle commented Aug 31, 2018

CORS headers and OPTIONS HTTP method support were added to QA in PR samvera/questioning_authority#172. At this writing, the PR is pending review and merge. It was added as a configurable option, so I do not expect any objects to it merging.

@elrayle
Copy link
Member

elrayle commented Aug 31, 2018

The CORS headers have been added to the min_context branch of QA.

Remaining Work:

  • setup on elr dev server to allow testing
  • test in an actual browser accessing cross-origin

@elrayle
Copy link
Member

elrayle commented Sep 14, 2018

This work is essentially done. It is configured to be enabled in cul-it/qa_server. It will be available in production when the production system comes back on line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa configs work needs to happen at the qa config level qa feature requires code change
Projects
None yet
Development

No branches or pull requests

2 participants