json-proxy icon indicating copy to clipboard operation
json-proxy copied to clipboard

enable CORS

Open Hagith opened this issue 9 years ago • 3 comments

Hagith avatar Oct 03 '16 14:10 Hagith

Apologies for getting to this late. Can this be tested?

According to https://github.com/nodejitsu/node-http-proxy/issues/382#issuecomment-14825372, the proxyRes event cannot modify the response.

steve-jansen avatar Oct 26 '16 00:10 steve-jansen

@Hagith @Cosaquee I've added you as collaborators to this repo. Merge away if you think it will help the community.

I could use help managing PRs, and appreciate your help with json-proxy 😄

steve-jansen avatar Oct 26 '16 00:10 steve-jansen

Thank you for review and greatly appreciate for adding me as collaborator.

Answer you mentioned is about modifying response body - yes, it's not possible, a specially for https. But we need to change response headers to allow CORS, and from our experience it's possible and it's working :)

I will add 2 more commit to this PR:

  • we tested this in the field, and for fully functional CORS, we need to add two more headers: Access-Control-Allow-Headers and Access-Control-Allow-Methods
  • will cover this case in spec

Hagith avatar Oct 27 '16 11:10 Hagith