Skip to content

connection of a 101 response is never closed #2708

Closed

Description

@dogancanbakir

On a 101 Switching Protocols response, Do wraps the body in io.NopCloser and skips the deferred close, so Body.Close() never closes the upgraded connection. It stays open after Do returns (reproduced via common/httpx with upgrade headers); with a zero read limit it is closed.

Reached from the CLI when upgrade headers are sent (e.g. -H "Upgrade: websocket"), one open connection per target. Found in review of #2705.

Activity

  1. self-assigned this
    on Nov 2, 2026
  2. added
    Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.
    on Nov 2, 2026
  3. added 2 commits that reference this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions