Skip to content

Add check for route handlers hanging requests #27

@aseemk

Description

@aseemk

It's possible to write an Express route that forgets to return a response in a certain case. E.g.:

app.get('/foo', function (req, res, _) {
    if (...) {
        res.render('foo');
    }
});

If this case is hit, the request will just hang, waiting for a response.

Express-Streamline could probably add a convenience check for this case. E.g. when a route handler "returns" (in Streamline parlance), if a response hasn't been sent (I'm assuming the response object will have some props we can inspect for this?), throw an error as it's probably a bug.

There's a chance it's not a bug, if the handler is doing something event-based and non-Streamline, but it's unlikely if you're using Express-Streamline. Still, we could make this an optional feature if so.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions