From 8321bc5fd2e512a207bb55cab751975ae5d00f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marie=20P=C3=ADchov=C3=A1?= Date: Fri, 9 Jul 2021 18:25:59 +0200 Subject: [PATCH] Removed nullability checks from FormUrlEncodedContent ctor --- src/libraries/System.Net.Http/ref/System.Net.Http.cs | 7 ++++++- .../src/System/Net/Http/FormUrlEncodedContent.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index 875a471418940..3cb29a543b077 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -37,7 +37,12 @@ protected override void Dispose(bool disposing) { } } public partial class FormUrlEncodedContent : System.Net.Http.ByteArrayContent { - public FormUrlEncodedContent(System.Collections.Generic.IEnumerable> nameValueCollection) : base (default(byte[])) { } + public FormUrlEncodedContent( + System.Collections.Generic.IEnumerable> nameValueCollection) : base (default(byte[])) { } protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } } public delegate System.Text.Encoding? HeaderEncodingSelector(string headerName, TContext context); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs index fe723de2c3330..abf61ca7ee051 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs @@ -12,7 +12,12 @@ namespace System.Net.Http { public class FormUrlEncodedContent : ByteArrayContent { - public FormUrlEncodedContent(IEnumerable> nameValueCollection) + public FormUrlEncodedContent( + IEnumerable> nameValueCollection) : base(GetContentByteArray(nameValueCollection)) { Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");