Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
CoryCharlton opened this issue Apr 25, 2025 · 0 comments · May be fixed by #61701
Open
1 task done

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

CoryCharlton opened this issue Apr 25, 2025 · 0 comments · May be fixed by #61701
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@CoryCharlton
Copy link

CoryCharlton commented Apr 25, 2025

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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Apr 25, 2025
CoryCharlton added a commit to CoryCharlton/aspnetcore that referenced this issue Apr 25, 2025
CoryCharlton added a commit to CoryCharlton/aspnetcore that referenced this issue Apr 25, 2025
@gfoidl gfoidl added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants