Fix CORS when static resources registered (#4727)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2016-12-04 10:57:24 -08:00
1 parent 93872590b6
commit 1b35f0878e
2 files changed
+12 -1

No files matched your search

@@ -277,9 +277,15 @@ class HomeAssistantWSGI(object):
@asyncio.coroutine
def start(self):
"""Start the wsgi server."""
cors_added = set()
if self.cors is not None:
for route in list(self.app.router.routes()):
if hasattr(route, 'resource'):
route = route.resource
if route in cors_added:
continue
self.cors.add(route)
cors_added.add(route)
if self.ssl_certificate:
context = ssl.SSLContext(SSL_VERSION)