bug: plugin wolf-rbac /apisix/plugin/wolf-rbac/login resturn header is text/plain , cors error #5165
Comments
|
You can add cors as a plugin interceptor: Line 30 in 3e18838 PR is welcome! |
|
add header_modify interceptors ? |
|
cors interceptors. We can reuse the code. |
|
My bad! It is not about providing cors to wolf-rbac login. We just need to fix the login handler with |
|
after at /usr/local/apisix/apisix/plugins/wolf-rabc.lua add core.response.set_header("Content-Type", "application/json" |
|
diff The work and not work I found when rabc-plugin register route ‘apisix/plugin/wolf-rbac/login’ then the Globalroute of cors plugin lose efficacy |
|
So we still need cors interceptors. |
|
yes, add cors interceptors ,the cors ‘s conf should use the route cors plugin config |
Hi @laokan and @spacewander sorry , I don't get your idea. Can you give more details. I want to fix this issue. |


Issue description
the pluginx wolf-rbac 's login url /apisix/plugin/wolf-rbac/login return the json but header give the content-type is text/plain, when the browsr crossdomain post then show the cors error, please change the plugin login post give the Content-type to application/json
The wolf-rabc 's login uri /apisix/plugin/wolf-rbac/login will lose the cors plugin add the Header
Environment
apisix version):uname -a):nginx -Voropenresty -V):curl http://127.0.0.1:9090/v1/server_infoto get the info from server-info API):luarocks --version):Steps to reproduce
post /apisix/plugin/wolf-rbac/login show the response header
Actual result
text/plain
Error log
the browser given the cors error
Expected result
No response
The text was updated successfully, but these errors were encountered: