diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs index 0fa8447d8f..293c3facc4 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Features; using Microsoft.Extensions.Primitives; @@ -145,7 +146,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http } } - IDictionary IHttpRequestFeature.Headers + IHeaderDictionary IHttpRequestFeature.Headers { get { @@ -197,7 +198,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http } } - IDictionary IHttpResponseFeature.Headers + IHeaderDictionary IHttpResponseFeature.Headers { get { diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs index 945bd3a105..f772b32da8 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs @@ -2,14 +2,13 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNet.Http.Features; +using Microsoft.AspNet.Http; using Microsoft.AspNet.Server.Kestrel.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; @@ -55,13 +54,13 @@ namespace Microsoft.AspNet.Server.Kestrel.Http public string Path { get; set; } public string QueryString { get; set; } public string HttpVersion { get; set; } - public IDictionary RequestHeaders { get; set; } + public IHeaderDictionary RequestHeaders { get; set; } public MessageBody MessageBody { get; set; } public Stream RequestBody { get; set; } public int StatusCode { get; set; } public string ReasonPhrase { get; set; } - public IDictionary ResponseHeaders { get; set; } + public IHeaderDictionary ResponseHeaders { get; set; } public Stream ResponseBody { get; set; } public Stream DuplexStream { get; set; } diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/FrameHeaders.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/FrameHeaders.cs index 18b19c114e..beb926447c 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/FrameHeaders.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/FrameHeaders.cs @@ -5,16 +5,31 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Microsoft.AspNet.Http; using Microsoft.Extensions.Primitives; namespace Microsoft.AspNet.Server.Kestrel.Http { - public abstract class FrameHeaders : IDictionary + public abstract class FrameHeaders : IHeaderDictionary { protected Dictionary MaybeUnknown; protected Dictionary Unknown => MaybeUnknown ?? (MaybeUnknown = new Dictionary(StringComparer.OrdinalIgnoreCase)); + StringValues IHeaderDictionary.this[string key] + { + get + { + StringValues value; + TryGetValueFast(key, out value); + return value; + } + set + { + SetValueFast(key, value); + } + } + StringValues IDictionary.this[string key] { get