SPUERSAIYAN opened a new issue, #6358:
URL: https://github.com/apache/shenyu/issues/6358
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Current Behavior
SandboxServiceImpl#requestProxyGateway calls HTTP_UTILS.requestCall(...) and
reads the returned ResponseBody, but the returned OkHttp Response is never
closed.
Since okhttp3.Response implements Closeable, callers should close it after
consuming the body.
### Expected Behavior
SandboxServiceImpl#requestProxyGateway should close the OkHttp Response
after copying the proxied response body.
For example:
try (Response resp = HTTP_UTILS.requestCall(uriComponents.toUriString(),
reqParams, header,
HttpUtils.HTTPMethod.fromValue(proxyGatewayDTO.getHttpMethod()),
files)) {
ResponseBody body = resp.body();
if (Objects.isNull(body)) {
return;
}
IOUtils.copy(body.byteStream(), response.getOutputStream());
response.flushBuffer();
}
This ensures that the response body and underlying connection resources are
released.
### Steps To Reproduce
_No response_
### Environment
```markdown
Module: shenyu-admin
```
### Debug logs
_No response_
### Anything else?
I’d like to work on this issue and submit a small, focused PR for it.
I’m interested in contributing to Apache ShenYu and hope this can be a good
starting point.
--
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: notifications-unsubscr...@shenyu.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org