* Fix CORS duplicate registration (#15670)

* Bumped version to 0.74.2
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-07-25 13:09:32 +02:00
1 parent 5e9c1098c0
commit 9d59bfbe00
4 files changed
+59 -23

No files matched your search

+3 -5
View File
@@ -69,15 +69,13 @@ class HomeAssistantView(object):
handler = request_handler_factory(self, handler)
for url in urls:
routes.append(
(method, router.add_route(method, url, handler))
)
routes.append(router.add_route(method, url, handler))
if not self.cors_allowed:
return
for method, route in routes:
app['allow_cors'](route, [method.upper()])
for route in routes:
app['allow_cors'](route)
def request_handler_factory(view, handler):