From 2e23501f9d122951328a4abccc8baadf696fd699 Mon Sep 17 00:00:00 2001 From: taoufik07 Date: Sun, 21 Oct 2018 18:15:13 +0100 Subject: [PATCH] Fix check_existing --- responder/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/responder/api.py b/responder/api.py index 1753b2f..c1af93b 100644 --- a/responder/api.py +++ b/responder/api.py @@ -335,9 +335,8 @@ class API: :param static: If ``True``, and no endpoint was passed, render "static/index.html", and it will become a default route. :param check_existing: If ``True``, an AssertionError will be raised, if the route is already defined. """ - # TODO: Fix - if check_existing and protocol != "ws": - assert route not in self.routes + if check_existing: + assert not (route in self.routes and self.routes[route].protocol == protocol) if not endpoint and static: endpoint = self.static_response