This repository was archived by the owner on Nov 20, 2018. It is now read-only.
File tree 3 files changed +21
-5
lines changed
src/Microsoft.AspNetCore.Http
test/Microsoft.AspNetCore.Http.Tests
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,19 @@ public class ResponseCookiesFeature : IResponseCookiesFeature
24
24
/// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>.
25
25
/// </param>
26
26
public ResponseCookiesFeature ( IFeatureCollection features )
27
+ : this ( features , builderPool : null )
28
+ {
29
+ }
30
+
31
+ /// <summary>
32
+ /// Initializes a new <see cref="ResponseCookiesFeature"/> instance.
33
+ /// </summary>
34
+ /// <param name="features">
35
+ /// <see cref="IFeatureCollection"/> containing all defined features, including this
36
+ /// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>.
37
+ /// </param>
38
+ /// <param name="builderPool">The <see cref="ObjectPool{T}"/>, if available.</param>
39
+ public ResponseCookiesFeature ( IFeatureCollection features , ObjectPool < StringBuilder > builderPool )
27
40
{
28
41
if ( features == null )
29
42
{
@@ -43,7 +56,7 @@ public IResponseCookies Cookies
43
56
if ( _cookiesCollection == null )
44
57
{
45
58
var headers = HttpResponseFeature . Headers ;
46
- _cookiesCollection = new ResponseCookies ( headers ) ;
59
+ _cookiesCollection = new ResponseCookies ( headers , null ) ;
47
60
}
48
61
49
62
return _cookiesCollection ;
Original file line number Diff line number Diff line change 3
3
4
4
using System ;
5
5
using System . Collections . Generic ;
6
+ using System . Text ;
7
+ using Microsoft . Extensions . ObjectPool ;
6
8
using Microsoft . Extensions . Primitives ;
7
9
using Microsoft . Net . Http . Headers ;
8
10
@@ -17,7 +19,8 @@ public class ResponseCookies : IResponseCookies
17
19
/// Create a new wrapper.
18
20
/// </summary>
19
21
/// <param name="headers">The <see cref="IHeaderDictionary"/> for the response.</param>
20
- public ResponseCookies ( IHeaderDictionary headers )
22
+ /// <param name="builderPool">The <see cref="ObjectPool{T}"/>, if available.</param>
23
+ public ResponseCookies ( IHeaderDictionary headers , ObjectPool < StringBuilder > builderPool )
21
24
{
22
25
if ( headers == null )
23
26
{
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public class ResponseCookiesTest
15
15
public void DeleteCookieShouldSetDefaultPath ( )
16
16
{
17
17
var headers = new HeaderDictionary ( ) ;
18
- var cookies = new ResponseCookies ( headers ) ;
18
+ var cookies = new ResponseCookies ( headers , null ) ;
19
19
var testcookie = "TestCookie" ;
20
20
21
21
cookies . Delete ( testcookie ) ;
@@ -31,7 +31,7 @@ public void DeleteCookieShouldSetDefaultPath()
31
31
public void NoParamsDeleteRemovesCookieCreatedByAdd ( )
32
32
{
33
33
var headers = new HeaderDictionary ( ) ;
34
- var cookies = new ResponseCookies ( headers ) ;
34
+ var cookies = new ResponseCookies ( headers , null ) ;
35
35
var testcookie = "TestCookie" ;
36
36
37
37
cookies . Append ( testcookie , testcookie ) ;
@@ -70,7 +70,7 @@ public void EscapesKeyValuesBeforeSettingCookie(
70
70
string expected )
71
71
{
72
72
var headers = new HeaderDictionary ( ) ;
73
- var cookies = new ResponseCookies ( headers ) ;
73
+ var cookies = new ResponseCookies ( headers , null ) ;
74
74
75
75
cookies . Append ( key , value ) ;
76
76
You can’t perform that action at this time.
0 commit comments