Fix CORS duplicate registration (#15670)
This commit is contained in:
1 parent
68f03dcc67
commit
169c8d793a
3 files changed
+58
-22
No files matched your search
@@ -69,15 +69,13 @@ class HomeAssistantView:
|
||||
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):
|
||||
|
||||
Reference in new issue
Block a user