-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
First try at implementing newly suggested ctor for providing tighter control over charset #63231
First try at implementing newly suggested ctor for providing tighter control over charset #63231
Conversation
…control over charset
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/ncl Issue DetailsThere are three new ctor implementations. All are from issue #17036. public StringContent(string content, MediaTypeHeaderValue mediaType) Also, there are tests for the new APIs.
|
@@ -437,8 +437,10 @@ public partial class StreamContent : System.Net.Http.HttpContent | |||
public partial class StringContent : System.Net.Http.ByteArrayContent | |||
{ | |||
public StringContent(string content) : base (default(byte[])) { } | |||
public StringContent(string content, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) : base (default(byte[])) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that for reference code that base()
should never be used. Of course this was what I thought when looking and changing the ones in System.IO.Compression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AraHaan I'm actually clueless on that point. What should be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I see that it already uses base()
so that file should be fine to do it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a markdown doc in this repo explaining how to update the ref files automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danmoseley Thank you for letting me know. After I follow the instructions in updating-ref-source.md I'm getting a large number of changes. Many of those changes I did not do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ideal, I think, is that the ref files are completely and only generated output. cc @safern for whether that's correct.
Meantime I suggest to just include relevant changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did a commit that hopefully updated the reference assembly correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danmoseley Was my latest commit sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brianmed looks right as far as I can tell, thanks. I guess @scalablecory plans to review now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danmoseley Just updated. Sorry it took a few days.
src/libraries/System.Net.Http/src/System/Net/Http/StringContent.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/Headers/MediaTypeHeaderValue.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/StringContent.cs
Outdated
Show resolved
Hide resolved
PR looks good to me, only nits to address. I believe @brianmed is away for a week or two without internet. |
Hello @brianmed, are you back from vacation? Do you have rough ETA when you think you can get to the remaining feedback? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
There are three new ctor implementations.
All are from issue #17036.
Also, there are tests for the new APIs.