Skip to content

CORS enabling #3629

Answered by achamayou
martijnlammers asked this question in Q&A
Mar 3, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

@martijnlammers my understanding of the implementation of CORS server side (derived from https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is that it consists entirely of the server setting the right HTTP headers on responses. Since CCF lets you set arbitrary response headers, I would say it's possible to do it, eg:

ctx.rpc_ctx->set_response_header(
    http::headers::CONTENT_TYPE, http::headervalues::contenttype::JSON);

If you mean support as in, does CCF implement any CORS-related logic that can be switched on with a flag, then no.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@martijnlammers
Comment options

Answer selected by martijnlammers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants