Update aiohttp to 2.3.1 (#10139)

* Update aiohttp to 2.3.1

* set timeout 10sec

* fix freeze with new middleware handling

* Convert middleware auth

* Convert mittleware ipban

* convert middleware static

* fix lint

* Update ban.py

* Update auth.py

* fix lint

* Fix tests
This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2017-11-05 18:42:31 -08:00
1 parent 39de557c4c
commit a9a3e24bde
8 files changed
+67 -92

No files matched your search

+6 -4
View File
@@ -182,8 +182,6 @@ class HomeAssistantWSGI(object):
use_x_forwarded_for, trusted_networks,
login_threshold, is_ban_enabled):
"""Initialize the WSGI Home Assistant server."""
import aiohttp_cors
middlewares = [auth_middleware, staticresource_middleware]
if is_ban_enabled:
@@ -206,6 +204,8 @@ class HomeAssistantWSGI(object):
self.server = None
if cors_origins:
import aiohttp_cors
self.cors = aiohttp_cors.setup(self.app, defaults={
host: aiohttp_cors.ResourceOptions(
allow_headers=ALLOWED_CORS_HEADERS,
@@ -335,7 +335,9 @@ class HomeAssistantWSGI(object):
_LOGGER.error("Failed to create HTTP server at port %d: %s",
self.server_port, error)
self.app._frozen = False # pylint: disable=protected-access
# pylint: disable=protected-access
self.app._middlewares = tuple(self.app._prepare_middleware())
self.app._frozen = False
@asyncio.coroutine
def stop(self):
@@ -345,7 +347,7 @@ class HomeAssistantWSGI(object):
yield from self.server.wait_closed()
yield from self.app.shutdown()
if self._handler:
yield from self._handler.finish_connections(60.0)
yield from self._handler.shutdown(10)
yield from self.app.cleanup()