8000 为什么我用了 没有覆盖cors的配置呀 · Issue #2 · temool/egg-origin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

为什么我用了 没有覆盖cors的配置呀 #2

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

Open
dirtypool96 opened this issue Apr 17, 2020 · 1 comment
Open

为什么我用了 没有覆盖cors的配置呀 #2

dirtypool96 opened this issue Apr 17, 2020 · 1 comment

Comments

@dirtypool96
Copy link

exports.cors = {
enable: true,
package: 'egg-cors',
};

exports.origin = {
enable: true,
package: 'egg-origin',
};


config.origin = {
whiteList: [ 'http://admin.dirtypool.top', 'http://blog.dirtypool.top' ],
};

config.security = {
csrf: {
enable: false,
},
domainWhiteList: ['*'],
};

config.cors = {
// 跨域带Cookie Origin不能为*
origin: [],
credentials: true, // 允许Cookie跨域
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
};

@dirtypool96
Copy link
Author

现在的egg-cors已经有白名单了,直接用domainwhite,不用Origin了

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

1 participant
0