Skip to content

Commit 84d483d

Browse files
committed
Fix test failure. Logic was using the platform charset for a request body if none was specified. Test ran fine within intellij as the default charset was macroman, however, when run from the commandline, the test would fail as the default would be UTF-8. ISO-8859-1 is now used if no encoding is specified.
1 parent cce8c8b commit 84d483d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

providers/grizzly/src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ public boolean doHandle(final FilterChainContext ctx,
19651965

19661966
String charset = request.getBodyEncoding();
19671967
if (charset == null) {
1968-
charset = Charsets.DEFAULT_CHARACTER_ENCODING;
1968+
charset = Charsets.ASCII_CHARSET.name();
19691969
}
19701970
final byte[] data = new String(request.getByteData(), charset).getBytes(charset);
19711971
final MemoryManager mm = ctx.getMemoryManager();
@@ -2068,7 +2068,7 @@ public boolean doHandle(final FilterChainContext ctx,
20682068
StringBuilder sb = null;
20692069
String charset = request.getBodyEncoding();
20702070
if (charset == null) {
2071-
charset = Charsets.DEFAULT_CHARACTER_ENCODING;
2071+
charset = Charsets.ASCII_CHARSET.name();
20722072
}
20732073
final FluentStringsMap params = request.getParams();
20742074
if (!params.isEmpty()) {

0 commit comments

Comments
 (0)