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

跨域配置无效 #28

Closed
yunxi177 opened this issue May 22, 2019 · 0 comments
Closed

跨域配置无效 #28

yunxi177 opened this issue May 22, 2019 · 0 comments

Comments

@yunxi177
Copy link

配置如下

# 跨域请求
[cors]
# 是否启用
enable = true
# 允许跨域请求的域名列表(*表示全部允许)
allow_origins = ["*"]
# 允许跨域请求的请求方式列表
allow_methods = ["GET","POST","PUT","DELETE","PATCH", "OPTIONS"]
# 允许客户端与跨域请求一起使用的非简单标头的列表
allow_headers = []
# 请求是否可以包含cookie,HTTP身份验证或客户端SSL证书等用户凭据
allow_credentials = true
# 可以缓存预检请求结果的时间(以秒为单位)
max_age = 7200

response headers 返回如下

Allow: GET,POST,OPTIONS,HEAD
Connection: Keep-Alive
Content-Length: 0
Date: Wed, 22 May 2019 15:27:55 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.38 (Ubuntu)

我试过不开启和开启跨域配置 response headers 返回不变, 感觉像跨域配置没生效,请问是不是我哪里设置的不对?

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