mirror of https://github.com/nicolargo/glances.git
Revert "Something in 4.3.2 broke the home assistant add-on for Glances - Try 1 #3238"
This reverts commit 76b070f3de.
This commit is contained in:
parent
76b070f3de
commit
fca11995cb
|
|
@ -141,6 +141,12 @@ class GlancesRestfulApi:
|
|||
self.TEMPLATE_PATH = os.path.join(webui_root_path, 'static/templates')
|
||||
self._templates = Jinja2Templates(directory=self.TEMPLATE_PATH)
|
||||
|
||||
# FastAPI Enable GZIP compression
|
||||
# https://fastapi.tiangolo.com/advanced/middleware/
|
||||
# Should be done before other middlewares to avoid
|
||||
# LocalProtocolError("Too much data for declared Content-Length")
|
||||
self._app.add_middleware(GZipMiddleware, minimum_size=1000)
|
||||
|
||||
# FastAPI Enable CORS
|
||||
# https://fastapi.tiangolo.com/tutorial/cors/
|
||||
self._app.add_middleware(
|
||||
|
|
@ -152,15 +158,6 @@ class GlancesRestfulApi:
|
|||
allow_headers=config.get_list_value('outputs', 'cors_headers', default=["*"]),
|
||||
)
|
||||
|
||||
# FastAPI Enable GZIP compression
|
||||
# https://fastapi.tiangolo.com/advanced/middleware/
|
||||
# Should be done before other middlewares to avoid
|
||||
# LocalProtocolError("Too much data for declared Content-Length")
|
||||
# but...
|
||||
# it introduce a regression in Home Assistant plugin (#3238)
|
||||
# so came back to the initital implementation
|
||||
self._app.add_middleware(GZipMiddleware, minimum_size=1000)
|
||||
|
||||
# FastAPI Define routes
|
||||
self._app.include_router(self._router())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue