Skip to content

Commit

Permalink
Fixed message decoding for jsonp-transport.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjoes committed Nov 18, 2011
1 parent 90f1c18 commit 0612c57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tornadio2/polling.py
Expand Up @@ -266,11 +266,12 @@ def post(self, session_id):
logging.error('Malformed JSONP POST request')
raise HTTPError(403)

# Special case
# Grab data
data = urllib.unquote(data[2:]).decode('utf-8')

# If starts with double quote, it is json encoded (socket.io workaround)
if data.startswith(u'"'):
data = data.strip(u'"')
data = proto.json_load(data)

# Process packets one by one
packets = proto.decode_frames(data)
Expand Down

0 comments on commit 0612c57

Please sign in to comment.