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

Commit 4195ace

Browse files
committed
React to IHeaderDictionary changes.
1 parent 1f50f4c commit 4195ace

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Text;
99
using System.Threading;
1010
using System.Threading.Tasks;
11+
using Microsoft.AspNet.Http;
1112
using Microsoft.AspNet.Server.Kestrel.Infrastructure;
1213
using Microsoft.Extensions.Logging;
1314
using Microsoft.Extensions.Primitives;
@@ -53,13 +54,13 @@ public Frame(ConnectionContext context) : base(context)
5354
public string Path { get; set; }
5455
public string QueryString { get; set; }
5556
public string HttpVersion { get; set; }
56-
public IDictionary<string, StringValues> RequestHeaders { get; set; }
57+
public IHeaderDictionary RequestHeaders { get; set; }
5758
public MessageBody MessageBody { get; set; }
5859
public Stream RequestBody { get; set; }
5960

6061
public int StatusCode { get; set; }
6162
public string ReasonPhrase { get; set; }
62-
public IDictionary<string, StringValues> ResponseHeaders { get; set; }
63+
public IHeaderDictionary ResponseHeaders { get; set; }
6364
public Stream ResponseBody { get; set; }
6465

6566
public Stream DuplexStream { get; set; }

src/Microsoft.AspNet.Server.Kestrel/Http/FrameHeaders.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,31 @@
55
using System.Collections;
66
using System.Collections.Generic;
77
using System.Linq;
8+
using Microsoft.AspNet.Http;
89
using Microsoft.Extensions.Primitives;
910

1011
namespace Microsoft.AspNet.Server.Kestrel.Http
1112
{
12-
public abstract class FrameHeaders : IDictionary<string, StringValues>
13+
public abstract class FrameHeaders : IHeaderDictionary
1314
{
1415
protected Dictionary<string, StringValues> MaybeUnknown;
1516

1617
protected Dictionary<string, StringValues> Unknown => MaybeUnknown ?? (MaybeUnknown = new Dictionary<string, StringValues>(StringComparer.OrdinalIgnoreCase));
1718

19+
StringValues IHeaderDictionary.this[string key]
20+
{
21+
get
22+
{
23+
StringValues value;
24+
TryGetValueFast(key, out value);
25+
return value;
26+
}
27+
set
28+
{
29+
SetValueFast(key, value);
30+
}
31+
}
32+
1833
StringValues IDictionary<string, StringValues>.this[string key]
1934
{
2035
get

src/Microsoft.AspNet.Server.Kestrel/ServerRequest.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.Linq;
88
using System.Threading.Tasks;
9+
using Microsoft.AspNet.Http;
910
using Microsoft.AspNet.Http.Features;
1011
using Microsoft.AspNet.Server.Kestrel.Http;
1112
using Microsoft.Extensions.Primitives;
@@ -109,7 +110,7 @@ string IHttpRequestFeature.QueryString
109110
}
110111
}
111112

112-
IDictionary<string, StringValues> IHttpRequestFeature.Headers
113+
IHeaderDictionary IHttpRequestFeature.Headers
113114
{
114115
get
115116
{
@@ -161,7 +162,7 @@ string IHttpResponseFeature.ReasonPhrase
161162
}
162163
}
163164

164-
IDictionary<string, StringValues> IHttpResponseFeature.Headers
165+
IHeaderDictionary IHttpResponseFeature.Headers
165166
{
166167
get
167168
{

0 commit comments

Comments
 (0)