Skip to content

response.finished ambiguityΒ #28412

Closed
Closed
@ronag

Description

@ronag

Currently, there is no intuitive way to check if a response actually has "finished". The current finished property just means that the user has "finished" (i.e. called end()) not that the response itself has finished, i.e. has either emitted finish or error (or close), which is what I believe is the currently assumed behavior by many developers (even Node veterans).

However, changing this behavior now would be a rather significant breaking change. Instead, I suggest adding a closed property similar to what already exists in the http/2 API which I believe would better fulfill the expected functionality.

Thoughts?

Refs:
#28411
#24347
jshttp/on-finished#30
jshttp/on-finished#31

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions