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 中间件支持和配置选项 #228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shua-github
Copy link

@Shua-github Shua-github commented Jan 23, 2025

默认CORS支持为关,需要在配置文件开启

[server]
CORS_switch = true

还可以自定义CORS配置

[server]
CORS_switch = true
CORS_config = { allow_origins = ["*"], allow_credentials = true, allow_methods = ["*"], allow_headers = ["*"] }

@MeetWq
Copy link
Collaborator

MeetWq commented Jan 24, 2025

这个哪里需要用?

@Shua-github
Copy link
Author

Shua-github commented Jan 24, 2025

这个哪里需要用?

浏览器调用API会遇到CORS问题(

image

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

Successfully merging this pull request may close these issues.

2 participants