Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 49b8b29

Browse files
committed
React to string[] -> StringValues changes.
1 parent 3480d53 commit 49b8b29

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/Microsoft.AspNet.TestHost/ClientHandler.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Collections.Generic;
56
using System.Diagnostics.CodeAnalysis;
67
using System.Diagnostics.Contracts;
78
using System.IO;
@@ -135,14 +136,14 @@ internal RequestState(HttpRequestMessage request, PathString pathBase, Cancellat
135136

136137
foreach (var header in request.Headers)
137138
{
138-
serverRequest.Headers.AppendValues(header.Key, header.Value.ToArray());
139+
serverRequest.Headers.Append(header.Key, header.Value.ToArray());
139140
}
140141
var requestContent = request.Content;
141142
if (requestContent != null)
142143
{
143144
foreach (var header in request.Content.Headers)
144145
{
145-
serverRequest.Headers.AppendValues(header.Key, header.Value.ToArray());
146+
serverRequest.Headers.Append(header.Key, header.Value.ToArray());
146147
}
147148
}
148149

@@ -187,9 +188,9 @@ internal HttpResponseMessage GenerateResponse()
187188

188189
foreach (var header in HttpContext.Response.Headers)
189190
{
190-
if (!response.Headers.TryAddWithoutValidation(header.Key, header.Value))
191+
if (!response.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value))
191192
{
192-
bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
193+
bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value);
193194
Contract.Assert(success, "Bad header");
194195
}
195196
}

src/Microsoft.AspNet.TestHost/RequestFeature.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using Microsoft.AspNet.Http.Features;
8+
using Microsoft.AspNet.Primitives;
89

910
namespace Microsoft.AspNet.TestHost
1011
{
@@ -13,7 +14,7 @@ internal class RequestFeature : IHttpRequestFeature
1314
public RequestFeature()
1415
{
1516
Body = Stream.Null;
16-
Headers = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase);
17+
Headers = new Dictionary<string, StringValues>(StringComparer.OrdinalIgnoreCase);
1718
Method = "GET";
1819
Path = "";
1920
PathBase = "";
@@ -24,7 +25,7 @@ public RequestFeature()
2425

2526
public Stream Body { get; set; }
2627

27-
public IDictionary<string, string[]> Headers { get; set; }
28+
public IDictionary<string, StringValues> Headers { get; set; }
2829

2930
public string Method { get; set; }
3031

src/Microsoft.AspNet.TestHost/ResponseFeature.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.IO;
77
using System.Threading.Tasks;
88
using Microsoft.AspNet.Http.Features;
9+
using Microsoft.AspNet.Primitives;
910

1011
namespace Microsoft.AspNet.TestHost
1112
{
@@ -16,7 +17,7 @@ internal class ResponseFeature : IHttpResponseFeature
1617

1718
public ResponseFeature()
1819
{
19-
Headers = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase);
20+
Headers = new Dictionary<string, StringValues>(StringComparer.OrdinalIgnoreCase);
2021
Body = new MemoryStream();
2122

2223
// 200 is the default status code all the way down to the host, so we set it
@@ -28,7 +29,7 @@ public ResponseFeature()
2829

2930
public string ReasonPhrase { get; set; }
3031

31-
public IDictionary<string, string[]> Headers { get; set; }
32+
public IDictionary<string, StringValues> Headers { get; set; }
3233

3334
public Stream Body { get; set; }
3435

0 commit comments

Comments
 (0)