Uh oh!
There was an error while loading. Please reload this page.
[release/7.0] Default media type used when 'null' is passed to StringContent #81506 - #83425
Conversation
ghost
commented
Mar 14, 2023
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBackport of #81722 to release/7.0 Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
This is annoying enough for customers (see updated Servicing template), that we should consider it for 7.0 servicing. Marking as such. |
carlossanlop
commented
Mar 28, 2023
I'm retargeting this PR to the new Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:
The new process is described here: runtime/docs/project/library-servicing.md. The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues. Let me know if you have any questions. |
antonfirsov
commented
Mar 29, 2023
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Test failures are unrelated.
All requirements listed in #83425 (comment) are met, I think we can merge this. |
antonfirsov
commented
Mar 30, 2023
@carlossanlop I don't have the rights to merge this. |
carlossanlop
commented
Mar 30, 2023
Fixed. Is the squash and merge button enabled for you now, @antonfirsov? We had some weird issues with GitHub Actions yesterday and the new |
antonfirsov
commented
Mar 30, 2023
@carlossanlop no, this is what I see: |
carlossanlop
commented
Mar 30, 2023
Ah, we had an unnecessary restriction, I removed it. Can you please refresh? Is the "squash and merge" button enabled for you now, @antonfirsov? |
antonfirsov
commented
Mar 30, 2023
@carlossanlop was good now, merged, thanks for the help! |

Backport of #81722 to release/7.0
Fixes#81506
/cc @antonfirsov@slovely
Customer Impact
We introduced an unintentional breaking change/regression in one of
StringContent's constructors in .NET 7.0: passingnullto the argstring contentTypeleads to an exception.In .NET 6.0 we would instead use default value
text/plain- see .NET 6.0 code.While it is easy to work around (check for null and pass 'text/plain' from user code), it has hit at least 3 customers (one of them was RestSharp - set of their customers hit it), so it is annoying, and it requires customers to change their code.
Testing
Targeted test case added in the PR.
Risk
Low. This is a fairly trivial change.