From e795cbddb6f268301fdd47d9977c42d9040450a2 Mon Sep 17 00:00:00 2001 From: Tyler Barrus Date: Tue, 20 Nov 2018 10:26:29 -0500 Subject: [PATCH 1/2] fix for route.is_class_based --- responder/api.py | 2 ++ responder/routes.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/responder/api.py b/responder/api.py index 005c153..d849d16 100644 --- a/responder/api.py +++ b/responder/api.py @@ -315,6 +315,8 @@ class API: params = route.incoming_matches(req.url.path) + cont = False + if route.is_function: try: try: diff --git a/responder/routes.py b/responder/routes.py index 598ebf1..eb77071 100644 --- a/responder/routes.py +++ b/responder/routes.py @@ -1,5 +1,6 @@ import re import functools +import inspect from parse import parse @@ -59,7 +60,7 @@ class Route: @property def is_class_based(self): - return hasattr(self.endpoint, "__class__") + return inspect.isclass(self.endpoint) @property def is_function(self): From ae06b3e01ab07025212d2376b78c7c27e32020dc Mon Sep 17 00:00:00 2001 From: Tyler Barrus Date: Tue, 20 Nov 2018 10:38:15 -0500 Subject: [PATCH 2/2] default cont to False --- responder/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responder/api.py b/responder/api.py index d849d16..7bee169 100644 --- a/responder/api.py +++ b/responder/api.py @@ -315,7 +315,7 @@ class API: params = route.incoming_matches(req.url.path) - cont = False + cont = True if route.is_function: try: