apache / apache/apisix-java-plugin-runner

help request: How to dynamic add/remove headers in "ext-plugin" with Java Runner

Đang mở
#219 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
152
Fork
102
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Description

Is it possible to dynamic to add headers in the ext-plugin (We implement a java based plugin with "apisix-runner-starter, 0.4.0" )?
the methods we tried this method:
` public void filter(HttpRequest request, HttpResponse response, PluginFilterChain chain `
...
` request.getHeaders().put("abc","abc");
request.getHeaders().put("567","565");`
...

Expectation:
upstream api receives the combined headers (original + dynamic).
client 10 headers --> apisix ext-plugin(java runner) add 2 headers=> 12 headers -> upstream, 12 headers

Actual
upstream api still receives the original headers
client 10 headers --> apisix ext-plugin(java runner) add 2 headers=> 12 headers -> upstream, 10 headers

We noticed that line 223 in the "RpcCallHandler" in the "org.apache.apisix.plugin.runner.handler" ;package
still using the original request, even the ext-plugin add or remove the header

Typically, data transmission after plugin should expose interface to implementer. but currently, plugin only could change the header value, could not dynamically add / remove headers

thx

### Environment

- APISIX version (run `apisix version`): 3.0
- Operating system (run `uname -a`): Centos7
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): 3.5.x
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners: apisix-runner-starter, 0.4.0
- LuaRocks version, for installation issues (run `luarocks --version`):

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.