Monday, September 25, 2017

Channels: Using `allowed_hosts_only` with `WebsocketDemultiplexer`

Hi there. I couldn't figure out how to use the allowed_hosts_only decorator with the connect method of WebsocketDemulitplexer. I ended up copying and pasting the relevant code into a mixin I could use directly with WebsocketDemultiplexer (removing __init__ and __call__, adding a connect method that performs what __call__ performed). This seems silly. Is there a way I could have used the decorator or is it possible that the methods in BaseOriginValidator should be altered so they can be used in mixins?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c7891571-70f6-481f-811c-3d78816314df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment