Skip to content

Commit

Permalink
fixes #19: use Flask's JSON serializers in gevent-socketio
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Apr 22, 2014
1 parent bf17472 commit 44c1453
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flask_socketio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
from flask import request, session
from flask import request, session, json
from werkzeug.debug import DebuggedApplication
from werkzeug.serving import run_with_reloader
from test_client import SocketIOTestClient
Expand All @@ -21,7 +21,8 @@ def __init__(self, app, socket):
def __call__(self, environ, start_response):
path = environ['PATH_INFO'].strip('/')
if path is not None and path.startswith('socket.io'):
socketio_manage(environ, self.socket.get_namespaces(), self.app)
socketio_manage(environ, self.socket.get_namespaces(), self.app,
json_loads=json.loads, json_dumps=json.dumps)
else:
return self.wsgi_app(environ, start_response)

Expand Down

0 comments on commit 44c1453

Please sign in to comment.