From 915d2732a1147c34664357b8c46b18746530f5d2 Mon Sep 17 00:00:00 2001 From: Kinware Date: Mon, 12 Mar 2018 20:21:59 +0100 Subject: [PATCH] Allow streaming handlers in add_route --- sanic/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index 6b83125d..87667825 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -220,7 +220,7 @@ class Sanic: name=name) def add_route(self, handler, uri, methods=frozenset({'GET'}), host=None, - strict_slashes=None, version=None, name=None): + strict_slashes=None, version=None, name=None, stream=False): """A helper method to register class instance or functions as a handler to the application url routes. @@ -233,9 +233,9 @@ class Sanic: :param strict_slashes: :param version: :param name: user defined route name for url_for + :param stream: boolean specifying if the handler is a stream handler :return: function or class instance """ - stream = False # Handle HTTPMethodView differently if hasattr(handler, 'view_class'): methods = set()