mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
Fix check_existing
This commit is contained in:
+2
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user