Skip to content

Commit

Permalink
Prevent double encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Nov 12, 2013
1 parent 5d7dced commit 0770b52
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ public byte[] transformPayload(AtmosphereResponse response, byte[] responseDraft
response.setCharacterEncoding(OUT_ENCODING);

CharBuffer cb = inCharset.newDecoder().decode(ByteBuffer.wrap(responseDraft, 0, responseDraft.length));
String s = cb.toString();

if (cb.toString().trim().length() == 0) {
if (s.trim().length() == 0 || s.indexOf(endString) != -1) {
logger.debug("Already filtered {}", s);
return responseDraft;
}

Expand Down

1 comment on commit 0770b52

@buildhive
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atmosphere Framework » atmosphere #1573 UNSTABLE
Looks like this commit caused a build failure
(what's this?)

Please sign in to comment.