1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-27 18:21:14 +03:00

Fix HttpLoggingInterceptor to be cool with newlines.

Unfortunately our plaintext detector treats \r and \n as non-plaintext
characters, and they're completely fine.

Closes: https://github.com/square/okhttp/issues/2579
This commit is contained in:
jwilson
2016-05-28 10:49:31 -04:00
parent 16aed96a35
commit 8271dc0fb1
2 changed files with 4 additions and 1 deletions

View File

@@ -283,7 +283,8 @@ public final class HttpLoggingInterceptor implements Interceptor {
if (prefix.exhausted()) {
break;
}
if (Character.isISOControl(prefix.readUtf8CodePoint())) {
int codePoint = prefix.readUtf8CodePoint();
if (Character.isISOControl(codePoint) && !Character.isWhitespace(codePoint)) {
return false;
}
}