apisix
apisix copied to clipboard
fix: ext-plugin request header cannot be override
Description
When I use go plugin runner to set the request header, such as content-type
, in apisix lua, it will become Content-Type
.
And due to case sensitivity, the request header cannot be correctly replicated.
By printing the params
through the log
https://github.com/apache/apisix/blob/2d47b4b3b33730b1de92c91c4fbe2b239ee339af/apisix/plugins/ext-plugin-post-resp.lua#L80-L85
it can be observed that both Content-Type
and content-type
can be observed simultaneously in the headers
.
Fixes # (issue) https://github.com/apache/apisix-go-plugin-runner/issues/155
Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [ ] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [x] I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)
Hi @zxyao145 could you add test cases in the PR?
Hi @zxyao145 could you add test cases in the PR?
Hi, I am sorry, I am not a Lua developer and not familiar with Lua. Could you provide relevant guidance?
Hi @zxyao145 could you add test cases in the PR?
Hi, I am sorry, I am not a Lua developer and not familiar with Lua. Could you provide relevant guidance?
hello!, u can check the other testcase and there are some guidance https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html https://github.com/openresty/test-nginx?tab=readme-ov-file#user-guide https://apisix.apache.org/zh/docs/apisix/next/internal/testing-framework/
Hi @zxyao145 could you add test cases in the PR?
Hi, I am sorry, I am not a Lua developer and not familiar with Lua. Could you provide relevant guidance?
hello!, u can check the other testcase and there are some guidance https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html https://github.com/openresty/test-nginx?tab=readme-ov-file#user-guide https://apisix.apache.org/zh/docs/apisix/next/internal/testing-framework/
@Vacant2333 Thanks! I need some time to do it.
@shreemaan-abhishek can u help him assign this issue?
@Vacant2333 Hi, I am not sure if there is a problem with this test as I am unable to run it locally (Windows). Could you please help me check it.
@zxyao145 maybe you can use a virtual machine?
@zxyao145 maybe you can use a virtual machine?
Sorry, there are no resources or conditions to create a virtual machine.
The pr won't be accepted if there are ci errors
I'm so sorry that I don't have extra time to solve the issue with testcase.
This PR will be closed. Thanks to everyone for their help in this PR.