You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to rewrite the request body and response body , and the RequestFilter method code is roughly as follows:
origBody:= []byte("{\"keyword\": \"xxxxx\"}")
log.Infof("request get Content-Length 1: %s", r.Header().Get("Content-Length"))
r.SetBody(origBody)
log.Infof("request get Content-Length 2: %s", r.Header().Get("Content-Length"))
r.Header().Set("Content-Length", strconv.Itoa(len(origBody)))
log.Infof("request get Content-Length 3: %s", r.Header().Get("Content-Length"))
and the log as follows:
request get Content-Length 1: 158
request get Content-Length 2: 158
request get Content-Length 3: 20
If I don't manually set the Content-Length, I will find that ResponseFilter method of the same plugin cannot be triggered and a timeout exception will occur.
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 462, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1344, in getresponse
response.begin()
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 307, in begin
version, status, reason = self._read_status()
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
If this is by design, please update the documentation and the demo.
Environment
APISIX Go Plugin Runner's version:
github.com/apache/apisix-go-plugin-runner v0.5.1-0.20231128010119-a265bcd63ca1
APISIX version:
3.6.0
Go version:
1.19
OS (cmd: uname -a):
debian:bullseye-slim
The text was updated successfully, but these errors were encountered:
Issue description
I am trying to rewrite the request body and response body , and the
RequestFilter
method code is roughly as follows:and the log as follows:
If I don't manually set the Content-Length, I will find that
ResponseFilter
method of the same plugin cannot be triggered and a timeout exception will occur.If this is by design, please update the documentation and the demo.
Environment
github.com/apache/apisix-go-plugin-runner v0.5.1-0.20231128010119-a265bcd63ca1
3.6.0
1.19
uname -a
):debian:bullseye-slim
The text was updated successfully, but these errors were encountered: