Skip to content

fix: /api/flow SSE endpoint hangs E2E health checks — add HEAD method support#248

Open
vivekchand wants to merge 1 commit intomainfrom
fix/e2e-flow-sse-head-20260320
Open

fix: /api/flow SSE endpoint hangs E2E health checks — add HEAD method support#248
vivekchand wants to merge 1 commit intomainfrom
fix/e2e-flow-sse-head-20260320

Conversation

@vivekchand
Copy link
Owner

Problem

E2E health check tests /api/flow with curl -s -o /dev/null -w '%{http_code}' expecting a 200 response code. However, /api/flow is an infinite SSE (Server-Sent Events) streaming endpoint — curl hangs indefinitely waiting for the stream to close, never capturing the HTTP status code.

Fix

Add HEAD method support to both /api/flow and /api/flow-events. HEAD requests return 200 immediately without starting the SSE generator, enabling health checks and E2E tests to verify the endpoint is alive without blocking.

if request.method == 'HEAD':
    return Response('', status=200, mimetype='text/event-stream',
                    headers={'Cache-Control': 'no-cache', 'X-Accel-Buffering': 'no'})

Test

curl -I http://localhost:8900/api/flow  # Returns 200 immediately

… support

E2E test checks /api/flow with curl and expects a 200 response code.
The endpoint is an infinite SSE stream, so curl hangs forever waiting
for the response to complete.

Add HEAD method support that returns 200 immediately without starting
the generator, enabling health checks and E2E tests to verify the
endpoint is alive without blocking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant