Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for http://java.net/jira/browse/ATMOSPHERE-116

("Improve atmosphere jquery plugin to support message lenght definition: trackMessageSize")
Fix NPE
  • Loading branch information...
commit 7dc0f42f889255addf6008065b6b4d066f612c4a 1 parent 2d08c9d
@jfarcand jfarcand authored
View
6 modules/cpr/src/main/java/org/atmosphere/client/TrackMessageSizeFilter.java
@@ -20,12 +20,14 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-public class TrackMessageSizeFilter implements PerRequestBroadcastFilter{
+public class TrackMessageSizeFilter implements PerRequestBroadcastFilter {
@Override
public BroadcastAction filter(HttpServletRequest request, HttpServletResponse response, Object message) {
- if (request.getHeader("X-Atmosphere-TrackMessageSize").equalsIgnoreCase("true") && String.class.isAssignableFrom(message.getClass())) {
+ if ("true".equalsIgnoreCase(request.getHeader("X-Atmosphere-TrackMessageSize"))
+ && message != null && String.class.isAssignableFrom(message.getClass())) {
+
String msg = message.toString();
msg = msg.length() + "|" + msg;
return new BroadcastAction(BroadcastAction.ACTION.CONTINUE, msg);
Please sign in to comment.
Something went wrong with that request. Please try again.