MrJoes/tornadio2 — Issue #8: JSONP double json encoding
Author: dividuum
Created: 2011-11-18 12:16:44+00:00
State: open

I'm getting unparsable data submitted by the jsonp transport. The reason for this seems to be this code in the client:

```javascript
// we temporarily stringify until we figure out how to prevent
// browsers from turning `\n` into `\r\n` in form inputs
this.area.value = io.JSON.stringify(data);
```

I'm not sure if the following change is the correct way to fix this in tornadio2/polling.py:

```diff
if data.startswith(u'"'):
- data = data.strip(u'"')
+ data = proto.json_load(data)
```