You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/12/04 01:51:23 UTC
[GitHub] [apisix-go-plugin-runner] A11enHuang opened a new issue #50: bug: 如果配置了plugin,前端调用的时候就会跨域
A11enHuang opened a new issue #50:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/50
APISIX VERSION: 2.10
APISIX-GO-PLUGIN VERSION: 0.2.0
问题描述:
在配置了plugin的情况下,前端调用后端接口会导致跨域。
本来就是从不同的域访问过来的,可是在APISIX的配置中已经允许所有的来源访问了。
但是在加了go-plugin的情况下就会报跨域。
APISIX配置如下:
"plugins": {
"proxy-rewrite": {
"regex_uri": [
"^/v1/admin/(.*)",
"/${1}"
],
"headers":{
"X-Forwarded-Prefix":"/v1/admin"
}
},
"cors": {},
"request-id": {
"include_in_response": true
},
"ext-plugin-pre-req": {
"conf": [
{
"name": "MicroserviceFilter",
"value": "{\"strip_prefix\":1}"
}
]
}
}
前端报错信息:
Access to fetch at 'xxxxx' from origin 'xxx' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-go-plugin-runner] spacewander closed issue #50: bug: 如果配置了plugin,前端调用的时候就会跨域
Posted by GitBox <gi...@apache.org>.
spacewander closed issue #50:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/50
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-go-plugin-runner] spacewander commented on issue #50: bug: 如果配置了plugin,前端调用的时候就会跨域
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #50:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/50#issuecomment-986158403
Look like an issue of your MicroserviceFilter plugin, which is not provided by this project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org