exceptionfactory commented on a change in pull request #5378:
URL: https://github.com/apache/nifi/pull/5378#discussion_r804985715
##########
File path:
nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/RestLookupService.java
##########
@@ -333,7 +335,8 @@ private void setProxy(OkHttpClient.Builder builder) {
final Record record;
try (final InputStream is = responseBody.byteStream();
final InputStream bufferedIn = new BufferedInputStream(is)) {
- record = handleResponse(bufferedIn,
responseBody.contentLength(), context);
+ String toString = IOUtils.toString(bufferedIn,
StandardCharsets.UTF_8);
+ record = handleResponse(new
ByteArrayInputStream(toString.getBytes(StandardCharsets.UTF_8)),
responseBody.contentLength(), context);
Review comment:
@MikeThomsen, I didn't notice this change before, but it seems
problematic. Reading in the entire response body to a string, and then
converting to a byte array before passing to `handleResponse()` could introduce
memory issues. Was there anything in particular that prompted this change, or
can it be reverted?
This appears to be the only non-test file changed, so everything else looks
good.
--
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]