Skip to content

Commit 6a1150d

Browse files
committed
LoggingIOSession: Fix off-by-one error
1 parent fb3f630 commit 6a1150d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/LoggingIOSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ void logData(final ByteBuffer data, final String prefix) {
273273

274274
for (int i = 0; i < chunk; i++) {
275275
final char ch = (char) line[i];
276-
if (ch > Chars.SP && ch <= Chars.DEL) {
276+
if (ch > Chars.SP && ch < Chars.DEL) {
277277
buf.append(ch);
278278
} else if (Character.isWhitespace(ch)) {
279279
buf.append(' ');

httpclient5/src/test/java/org/apache/hc/client5/http/impl/async/LoggingIOSessionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void allBytes() {
6161
verify(wireLog).debug("IOSession << @ABCDEFGHIJKLMNO 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f");
6262
verify(wireLog).debug("IOSession << PQRSTUVWXYZ[\\]^_ 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f");
6363
verify(wireLog).debug("IOSession << `abcdefghijklmno 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f");
64-
verify(wireLog).debug("IOSession << pqrstuvwxyz{|}~\u007F 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f");
64+
verify(wireLog).debug("IOSession << pqrstuvwxyz{|}~. 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f");
6565
verify(wireLog).debug("IOSession << ................ 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f");
6666
verify(wireLog).debug("IOSession << ................ 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f");
6767
verify(wireLog).debug("IOSession << ................ a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af");

0 commit comments

Comments
 (0)