Skip to content
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

Properly Implement StringSegment and StringSegmentComparer GetHashCode #457

Closed
aspnet-hello opened this issue Jan 1, 2018 · 5 comments
Closed
Assignees

Comments

@aspnet-hello
Copy link

From @Tratcher on Monday, May 22, 2017 3:41:08 AM

#213
StringSegment.GetHashCode and StringSegmentComparer.GetHashCode(StringSegment) both substring and then string.GetHashCode() which defeats the purpose of using StringSegment.

Note that .NET Core strings use randomized hash codes to mitigate issues like dictionary hash collision attacks.

The header parsers in HttpAbstractions call both of these methods the header value types GetHashCode implementations, but I'm not aware of any instances where those header value types are used as keys into hashed collections.

Copied from original issue: #232

@mkArtakMSFT
Copy link
Member

@Tratcher, I'm inclined to closing this as there has been no community interest in this task. Any objections?

@pranavkm
Copy link

pranavkm commented Oct 1, 2018

https://github.com/dotnet/corefx/issues/31302 would solve our scenario rather nicely. I'd recommend keeping this open until that issue is resolved.

@mkArtakMSFT
Copy link
Member

Thanks @pranavkm. Assigning this to you for tracking purposes only.

@pranavkm
Copy link

pranavkm commented Oct 8, 2018

https://github.com/dotnet/corefx/issues/31302 is assigned to 3.0. Moving this out to the next milestone.

@Eilon Eilon transferred this issue from dotnet/aspnetcore Nov 5, 2018
@Eilon Eilon added this to the 3.0.0-preview1 milestone Nov 5, 2018
@rynowak rynowak removed the blocked label Nov 9, 2018
@rynowak
Copy link
Member

rynowak commented Nov 9, 2018

This is no longer blocked 👍 See: https://github.com/dotnet/coreclr/pull/20422/files#diff-3f06377a79f6009a753e2864e9bdaab6R774

We should look for other places we can use this new functionality - possibly ModelStateDictionary or anywhere else that StringSegment is used.

natemcmaster pushed a commit that referenced this issue Nov 21, 2018
* Remove JSON output and convert to sample

GlennC and I made the decisison to turn the JSON output into a sample
rather than something we support out of the box. We wouldn't tell
customers to definitely use it and we don't want to introduce more
coupling to JSON.NET.
@Eilon Eilon modified the milestones: 3.0.0-preview1, 3.0.0-preview2 Dec 13, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2019
maryamariyan pushed a commit to maryamariyan/runtime that referenced this issue Feb 28, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this issue Mar 2, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this issue Mar 11, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this issue Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants