Skip to content

Commit 8321bc5

Browse files
committed
Removed nullability checks from FormUrlEncodedContent ctor
1 parent 7b0cdaf commit 8321bc5

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/libraries/System.Net.Http/ref/System.Net.Http.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ protected override void Dispose(bool disposing) { }
3737
}
3838
public partial class FormUrlEncodedContent : System.Net.Http.ByteArrayContent
3939
{
40-
public FormUrlEncodedContent(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string?, string?>> nameValueCollection) : base (default(byte[])) { }
40+
public FormUrlEncodedContent(
41+
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<
42+
#nullable disable
43+
string, string
44+
#nullable restore
45+
>> nameValueCollection) : base (default(byte[])) { }
4146
protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; }
4247
}
4348
public delegate System.Text.Encoding? HeaderEncodingSelector<TContext>(string headerName, TContext context);

src/libraries/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ namespace System.Net.Http
1212
{
1313
public class FormUrlEncodedContent : ByteArrayContent
1414
{
15-
public FormUrlEncodedContent(IEnumerable<KeyValuePair<string?, string?>> nameValueCollection)
15+
public FormUrlEncodedContent(
16+
IEnumerable<KeyValuePair<
17+
#nullable disable
18+
string, string
19+
#nullable restore
20+
>> nameValueCollection)
1621
: base(GetContentByteArray(nameValueCollection))
1722
{
1823
Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");

0 commit comments

Comments
 (0)