Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

原来的getResponseBody方法在某些情况下会误修改responseBody,引发问题,改为直接使用byte数组来避免数据被篡改 #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trytocatch
Copy link

apache-http-client-plugin中,ApacheHttpClientProcessor.getResponseBody方法在某此场景下会篡改responseBody,造成业务代码中拿到了错误的http返回结果。

问题的根源在于,此方法中,先将body中的二进制流读取为String,然后再将String通过getBytes()方法转为byte数组,并作写回responseBody,而这个byte[]->String->byte[]的过程,前后的两个byte数组可能会不一样。

改为直接使用byte数组来避免数据被篡改。

to fix #207

@CLAassistant
Copy link

CLAassistant commented May 22, 2023

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants