mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Implement default websocket.connect consumer.
This commit is contained in:
parent
69168545d4
commit
be127611e5
|
@ -53,6 +53,10 @@ class Router(object):
|
|||
# called once, thankfully.
|
||||
from .handler import ViewConsumer
|
||||
self.add_route(Route("http.request", http_consumer or ViewConsumer()))
|
||||
# We also add a no-op websocket.connect consumer to the bottom, as the
|
||||
# spec requires that this is consumed, but Channels does not. Any user
|
||||
# consumer will override this one.
|
||||
self.add_route(Route("websocket.connect", null_consumer))
|
||||
|
||||
@classmethod
|
||||
def resolve_routing(cls, routing):
|
||||
|
@ -239,6 +243,12 @@ class Include(object):
|
|||
return result
|
||||
|
||||
|
||||
def null_consumer(*args, **kwargs):
|
||||
"""
|
||||
Standard no-op consumer.
|
||||
"""
|
||||
|
||||
|
||||
# Lowercase standard to match urls.py
|
||||
route = Route
|
||||
route_class = RouteClass
|
||||
|
|
Loading…
Reference in New Issue
Block a user