Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15175,6 +15175,10 @@ def _check_auth():
return # Fleet API uses its own X-Fleet-Key authentication
if not request.path.startswith('/api/'):
return # HTML, static, etc. are fine
# Localhost requests are always trusted (health checks, E2E tests, local tooling)
remote = request.remote_addr or ''
if remote in ('127.0.0.1', '::1', 'localhost'):
return
if not GATEWAY_TOKEN:
return jsonify({'error': 'Gateway token not configured. Please set up your gateway token first.', 'needsSetup': True}), 401
token = request.headers.get('Authorization', '').replace('Bearer ', '').strip()
Expand Down Expand Up @@ -16444,6 +16448,11 @@ def generate():
f.seek(0, 2)
jsonl_pos = f.tell()

# Send initial keepalive so SSE response headers are flushed immediately.
# This allows health checks (curl -o /dev/null -w '%{http_code}') to get
# a 200 status without waiting for the first real event.
yield ': keepalive\n\n'

try:
while True:
if time.time() - started > SSE_MAX_SECONDS:
Expand Down
Loading