diff --git a/src/Microsoft.AspNet.TestHost/ClientHandler.cs b/src/Microsoft.AspNet.TestHost/ClientHandler.cs index a5f61bd4f9..df72462e24 100644 --- a/src/Microsoft.AspNet.TestHost/ClientHandler.cs +++ b/src/Microsoft.AspNet.TestHost/ClientHandler.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.IO; @@ -135,14 +136,14 @@ namespace Microsoft.AspNet.TestHost foreach (var header in request.Headers) { - serverRequest.Headers.AppendValues(header.Key, header.Value.ToArray()); + serverRequest.Headers.Append(header.Key, header.Value.ToArray()); } var requestContent = request.Content; if (requestContent != null) { foreach (var header in request.Content.Headers) { - serverRequest.Headers.AppendValues(header.Key, header.Value.ToArray()); + serverRequest.Headers.Append(header.Key, header.Value.ToArray()); } } @@ -187,9 +188,9 @@ namespace Microsoft.AspNet.TestHost foreach (var header in HttpContext.Response.Headers) { - if (!response.Headers.TryAddWithoutValidation(header.Key, header.Value)) + if (!response.Headers.TryAddWithoutValidation(header.Key, (IEnumerable)header.Value)) { - bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, header.Value); + bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, (IEnumerable)header.Value); Contract.Assert(success, "Bad header"); } } diff --git a/src/Microsoft.AspNet.TestHost/RequestFeature.cs b/src/Microsoft.AspNet.TestHost/RequestFeature.cs index eebdd28372..b55b02b6ff 100644 --- a/src/Microsoft.AspNet.TestHost/RequestFeature.cs +++ b/src/Microsoft.AspNet.TestHost/RequestFeature.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using Microsoft.AspNet.Http.Features; +using Microsoft.Framework.Primitives; namespace Microsoft.AspNet.TestHost { @@ -13,7 +14,7 @@ namespace Microsoft.AspNet.TestHost public RequestFeature() { Body = Stream.Null; - Headers = new Dictionary(StringComparer.OrdinalIgnoreCase); + Headers = new Dictionary(StringComparer.OrdinalIgnoreCase); Method = "GET"; Path = ""; PathBase = ""; @@ -24,7 +25,7 @@ namespace Microsoft.AspNet.TestHost public Stream Body { get; set; } - public IDictionary Headers { get; set; } + public IDictionary Headers { get; set; } public string Method { get; set; } diff --git a/src/Microsoft.AspNet.TestHost/ResponseFeature.cs b/src/Microsoft.AspNet.TestHost/ResponseFeature.cs index 25d9b3260d..2f699e572d 100644 --- a/src/Microsoft.AspNet.TestHost/ResponseFeature.cs +++ b/src/Microsoft.AspNet.TestHost/ResponseFeature.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Microsoft.AspNet.Http.Features; +using Microsoft.Framework.Primitives; namespace Microsoft.AspNet.TestHost { @@ -16,7 +17,7 @@ namespace Microsoft.AspNet.TestHost public ResponseFeature() { - Headers = new Dictionary(StringComparer.OrdinalIgnoreCase); + Headers = new Dictionary(StringComparer.OrdinalIgnoreCase); Body = new MemoryStream(); // 200 is the default status code all the way down to the host, so we set it @@ -28,7 +29,7 @@ namespace Microsoft.AspNet.TestHost public string ReasonPhrase { get; set; } - public IDictionary Headers { get; set; } + public IDictionary Headers { get; set; } public Stream Body { get; set; }