React to breaking changes in StringValues
This commit is contained in:
parent
151b0f3a16
commit
f88631efb3
|
|
@ -123,7 +123,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
StringValues value;
|
||||
return
|
||||
TryGetValueFast(item.Key, out value) &&
|
||||
object.Equals(value, item.Value);
|
||||
value.Equals(item.Value);
|
||||
}
|
||||
|
||||
bool IDictionary<string, StringValues>.ContainsKey(string key)
|
||||
|
|
@ -152,7 +152,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
StringValues value;
|
||||
return
|
||||
TryGetValueFast(item.Key, out value) &&
|
||||
object.Equals(value, item.Value) &&
|
||||
value.Equals(item.Value) &&
|
||||
RemoveFast(item.Key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
public static bool TryGet(IDictionary<string, StringValues> headers, string name, out string value)
|
||||
{
|
||||
StringValues values;
|
||||
if (!headers.TryGetValue(name, out values) || values == null)
|
||||
if (!headers.TryGetValue(name, out values) || values.Count == 0)
|
||||
{
|
||||
value = null;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
IDictionary<string, StringValues> headers = new FrameRequestHeaders();
|
||||
var kv1 = new KeyValuePair<string, StringValues>("host", new[] { "localhost" });
|
||||
var kv2 = new KeyValuePair<string, StringValues>("custom", new[] { "value" });
|
||||
var kv1b = new KeyValuePair<string, StringValues>("host", new[] { "localhost" });
|
||||
var kv2b = new KeyValuePair<string, StringValues>("custom", new[] { "value" });
|
||||
var kv1b = new KeyValuePair<string, StringValues>("host", new[] { "not-localhost" });
|
||||
var kv2b = new KeyValuePair<string, StringValues>("custom", new[] { "not-value" });
|
||||
|
||||
Assert.False(headers.ContainsKey("host"));
|
||||
Assert.False(headers.ContainsKey("custom"));
|
||||
|
|
|
|||
|
|
@ -14,23 +14,20 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
private readonly IApplicationEnvironment env;
|
||||
private readonly IServiceProvider sp;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IApplicationShutdown _shutdown;
|
||||
|
||||
public Program(
|
||||
IApplicationEnvironment env,
|
||||
IServiceProvider sp,
|
||||
ILibraryManager libraryManager,
|
||||
IApplicationShutdown shutown)
|
||||
ILibraryManager libraryManager)
|
||||
{
|
||||
this.env = env;
|
||||
this.sp = sp;
|
||||
_libraryManager = libraryManager;
|
||||
_shutdown = shutown;
|
||||
}
|
||||
|
||||
public int Main()
|
||||
{
|
||||
return new Xunit.Runner.Dnx.Program(env, sp, _libraryManager, _shutdown).Main(new string[]
|
||||
return new Xunit.Runner.Dnx.Program(env, sp, _libraryManager).Main(new string[]
|
||||
{
|
||||
"-class",
|
||||
typeof(MultipleLoopTests).FullName
|
||||
|
|
|
|||
Loading…
Reference in New Issue