Skip to content

net/http: ResponseWriter panics in WriteHeaders that were formerly ignored #23010

@rsc

Description

@rsc

See comments on CL 80077.

I am worried about (accidental) sequences like:

w.Write([]byte("whatever"))
w.WriteHeader(badCode)

or

w.Hijack()
w.WriteHeader(badCode)

Those WriteHeader calls were formerly reported in a logf as out of sequence but otherwise ignored. They should probably continue to be logf+no-op instead of causing a panic.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions