Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
boke0 committed Mar 8, 2021
1 parent 8c0edb4 commit dee5092
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions mitama/app/http/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import http.cookies
import io
import json
import importlib
import wsgiref.util as wsgiutil
import uwsgi
from urllib.parse import parse_qs


Expand All @@ -27,11 +27,18 @@ def get(self, key):

class uWSGIWebSocket:
def __init__(self, env):
uwsgi.websocket_handshake(env['HTTP_SEC_WEBSOCKET_KEY'], env.get('HTTP_ORIGIN', ''))
self.uwsgi = importlib.import_module("uwsgi")
self.uwsgi.websocket_handshake(
env['HTTP_SEC_WEBSOCKET_KEY'],
env.get('HTTP_ORIGIN', '')
)

def receive(self):
return uwsgi.websocket_recv()
return self.uwsgi.websocket_recv()

def send(self, message):
uwsgi.websocket_send(message)
self.uwsgi.websocket_send(message)


class _RequestPayload:
def __init__(self, field_storage):
Expand Down

0 comments on commit dee5092

Please sign in to comment.