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

Newline characters stripped out #18

Open
mystcmage opened this issue Jan 15, 2025 · 0 comments
Open

Newline characters stripped out #18

mystcmage opened this issue Jan 15, 2025 · 0 comments

Comments

@mystcmage
Copy link

HttpMocaConnection is stripping out the newline characters with this line:
final String responseBody = in.lines().collect(Collectors.joining());

I suggest replacing it with:

    		StringBuilder buf = new StringBuilder();
    		int charsRead;
    		char[] cbuf = new char[1024];
    		while ((charsRead = in.read(cbuf)) != -1) {
    			buf.append(cbuf, 0, charsRead);
    		}	
    		final String responseBody = buf.toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant