You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by be...@apache.org on 2012/10/08 19:27:53 UTC
svn commit: r1395682 -
/mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/main/java/org/apache/vysper/xmpp/extension/xep0124/BoshBackedSessionContext.java
Author: berndf
Date: Mon Oct 8 17:27:52 2012
New Revision: 1395682
URL: http://svn.apache.org/viewvc?rev=1395682&view=rev
Log:
VYSPER-325: correctly encode BoshResponse body as UTF-8
Modified:
mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/main/java/org/apache/vysper/xmpp/extension/xep0124/BoshBackedSessionContext.java
Modified: mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/main/java/org/apache/vysper/xmpp/extension/xep0124/BoshBackedSessionContext.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/main/java/org/apache/vysper/xmpp/extension/xep0124/BoshBackedSessionContext.java?rev=1395682&r1=1395681&r2=1395682&view=diff
==============================================================================
--- mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/main/java/org/apache/vysper/xmpp/extension/xep0124/BoshBackedSessionContext.java (original)
+++ mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/main/java/org/apache/vysper/xmpp/extension/xep0124/BoshBackedSessionContext.java Mon Oct 8 17:27:52 2012
@@ -20,6 +20,7 @@
package org.apache.vysper.xmpp.extension.xep0124;
import java.io.IOException;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
@@ -61,6 +62,8 @@ public class BoshBackedSessionContext ex
public final static String BOSH_REQUEST_ATTRIBUTE = "boshRequest";
public final static String BOSH_RESPONSE_ATTRIBUTE = "boshResponse";
+ protected static final Charset UTF8_CHARSET = Charset.forName("UTF-8");
+
private final int maxpauseSeconds = 120;
private final int inactivitySeconds = 60;
@@ -807,7 +810,7 @@ public class BoshBackedSessionContext ex
if (ack != null) {
stanza = BoshStanzaUtils.addAttribute(stanza, "ack", ack.toString());
}
- byte[] content = new Renderer(stanza).getComplete().getBytes();
+ byte[] content = new Renderer(stanza).getComplete().getBytes(UTF8_CHARSET);
return new BoshResponse(contentType, content);
}