From b08b2d3baa9433c1a603863f2f003f24be15000c Mon Sep 17 00:00:00 2001 From: Evgeny Sorokin Date: Wed, 3 Apr 2024 04:05:00 +0300 Subject: add /debug.cgi --- bin/web_kbn.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/web_kbn.py b/bin/web_kbn.py index 8226b40..add7af2 100755 --- a/bin/web_kbn.py +++ b/bin/web_kbn.py @@ -442,7 +442,7 @@ async def cams(req: web.Request): mode = {'type': 'all'} js_config = { - 'host': config.app_config['cam_hls_host'], + 'host': config.app_config['hls_local_host'], 'proto': 'http', 'cams': cams, 'hlsConfig': { @@ -552,6 +552,17 @@ async def routing_dhcp(req: web.Request): context=dict(leases=leases, selected_tab='dhcp')) +@routes.get('/debug.cgi') +async def debug(req: web.Request): + info = dict( + headers=req.headers, + host=req.headers.get('Host'), + url=req.url, + method=req.method, + ) + return await http.ajax_ok(info) + + def init_web_app(app: web.Application): app.middlewares.append(language_middleware) aiohttp_jinja2.setup( -- cgit v1.2.3