zxyao145 opened a new issue, #153:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/153
### Issue description
I am trying to get pkgHTTP.Request in ResponseFilter method. I have
modified the `HTTPRespCall` method in
`apisix-go-plugin-runner/internal/plugin/plugin.go` as follows:
```go
func HTTPRespCall(buf []byte, conn net.Conn) (*flatbuffers.Builder, error) {
+ req := inHTTP.CreateRequest(buf)
+ req.BindConn(conn)
+ defer inHTTP.ReuseRequest(req)
resp := inHTTP.CreateResponse(buf)
resp.BindConn(conn)
defer inHTTP.ReuseResponse(resp)
token := resp.ConfToken()
conf, err := GetRuleConf(token)
if err != nil {
return nil, err
}
+ err = ResponsePhase.filter(conf, resp, req)
// ....
}
```
But I found that all the properties I received was empty. How should I
handle it?
```bash
request: &{r:0xc0003ea860 conn:0xc0000122d8 extraInfoHeader:[] path:[]
hdr:0xc0000122e8 rawHdr:map[] args:map[] rawArgs:map[] vars:map[] body:[]
ctx:0xc00049d5c0 cancel:0x531ae0 respHdr:map[]}%!(EXTRA http.Header=map[])
```
If this modification is completed, I am willing to submit a PR.
### Environment
* APISIX Go Plugin Runner's version: latest
* APISIX version: 3.6.0
* Go version: 1.19.4
* OS (cmd: `uname -a`): debian
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]