Permalink
Browse files

Account for iolist payloads, since that's what Misultin supplies

  • Loading branch information...
1 parent 68457c3 commit fb32ebba863770423c32a9b8e70dd458e75d0c79 @squaremo squaremo committed Jan 5, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/sockjs_util.erl
View
@@ -35,9 +35,11 @@ eep0018(JSON, decode) -> json:decode(JSON).
jiffy(Thing, encode) ->
iolist_to_binary(jiffy:encode(Thing));
-jiffy(JSON, decode) ->
+jiffy(JSON, decode) when is_binary(JSON) ->
try jiffy:decode(JSON) of
V -> {ok, V}
catch
E -> E
- end.
+ end;
+jiffy(JSON, decode) ->
+ jiffy(iolist_to_binary(JSON), decode).

0 comments on commit fb32ebb

Please sign in to comment.