Skip to content

Commit 3f15d26

Browse files
authored
Obsolete the ResponseCookiesFeature constructor (#24546)
1 parent 1f5149a commit 3f15d26

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Http/Http/src/Features/ResponseCookiesFeature.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ public class ResponseCookiesFeature : IResponseCookiesFeature
2626
/// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>.
2727
/// </param>
2828
public ResponseCookiesFeature(IFeatureCollection features)
29-
: this(features, builderPool: null)
3029
{
30+
if (features == null)
31+
{
32+
throw new ArgumentNullException(nameof(features));
33+
}
34+
35+
_features.Initalize(features);
3136
}
3237

3338
/// <summary>
@@ -38,6 +43,7 @@ public ResponseCookiesFeature(IFeatureCollection features)
3843
/// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>.
3944
/// </param>
4045
/// <param name="builderPool">The <see cref="ObjectPool{T}"/>, if available.</param>
46+
[Obsolete("This constructor is obsolete and will be removed in a future version.")]
4147
public ResponseCookiesFeature(IFeatureCollection features, ObjectPool<StringBuilder>? builderPool)
4248
{
4349
if (features == null)

0 commit comments

Comments
 (0)