原来的getResponseBody方法在某些情况下会误修改responseBody,引发问题,改为直接使用byte数组来避免数据被篡改 #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
apache-http-client-plugin中,ApacheHttpClientProcessor.getResponseBody方法在某此场景下会篡改responseBody,造成业务代码中拿到了错误的http返回结果。
问题的根源在于,此方法中,先将body中的二进制流读取为String,然后再将String通过getBytes()方法转为byte数组,并作写回responseBody,而这个byte[]->String->byte[]的过程,前后的两个byte数组可能会不一样。
改为直接使用byte数组来避免数据被篡改。
to fix #207