Skip to content

HeaderDictionary.Enumerator.Reset() does not work. #61699

Open
@CoryCharlton

Description

@CoryCharlton

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Calling Reset() on HeaderDictionary.Enumerator does not result in the enumerator being reset.

The issue is caused by the cast shown here which results in the underlying enumerator being copied by value.

Expected Behavior

The enumerator is reset to the initial state.

Steps To Reproduce

https://github.com/CoryCharlton/HeaderDictionary_Enumerator_Reset

Exceptions (if any)

No response

.NET Version

9.0.203

Anything else?

PR that implements proposed fix is here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions