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 Options #38

Open
cloudfysystems opened this issue May 29, 2019 · 1 comment
Open

CORS Options #38

cloudfysystems opened this issue May 29, 2019 · 1 comment

Comments

@cloudfysystems
Copy link

Hello,

I need to pass CORS headers into the OPTIONS request. Chrome block the request before it can get into the plugin:

`(window).webserver.onRequest(
function (request) {
debugger;
console.log("O MA GAWD! This is the request: ", request);

                    (<any>window).webserver.sendResponse(
                        request.requestId,
                        {
                            status: 200,
                            body: '<html>Hello World</html>',
                            headers: {
                                'content-type': 'text/html',
                                "Access-Control-Allow-Origin": "*",
                                "Access-Control-Allow-Headers" : "content-type,transaction",
                                "Access-Control-Allow-Methods" : "GET,HEAD,PUT,PATCH,POST,DELETE"
                            }
                        }
                    );
                }
            );`

Is there any way to implement it?

@dev-ankur
Copy link

@cloudfysystems Its been months, have you got any solution? I really need to know! I'm using ionic 4.

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