React to string[] -> StringValue changes.

This commit is contained in:
Chris R 2015-08-28 14:43:26 -07:00
parent b95f67733d
commit 7b11506cc0
4 changed files with 9 additions and 15 deletions

View File

@ -118,7 +118,7 @@ namespace Microsoft.AspNet.Diagnostics.Elm
}
if (context.Request.Query.ContainsKey("name"))
{
var namePrefix = context.Request.Query.GetValues("name")[0];
var namePrefix = context.Request.Query["name"];
options.NamePrefix = namePrefix;
}
}

View File

@ -7,6 +7,7 @@ using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Features;
using Microsoft.Framework.Logging;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNet.Diagnostics
{
@ -87,10 +88,10 @@ namespace Microsoft.AspNet.Diagnostics
private Task ClearCacheHeaders(object state)
{
var response = (HttpResponse)state;
response.Headers.Set("Cache-Control", "no-cache");
response.Headers.Set("Pragma", "no-cache");
response.Headers.Set("Expires", "-1");
response.Headers.Remove("ETag");
response.Headers[HeaderNames.CacheControl] = "no-cache";
response.Headers[HeaderNames.Pragma] = "no-cache";
response.Headers[HeaderNames.Expires] = "-1";
response.Headers.Remove(HeaderNames.ETag);
return Task.FromResult(0);
}
}

View File

@ -27,7 +27,7 @@ using System.Globalization
#line 3 "DiagnosticsPage.cshtml"
Response.ContentType = "text/html";
string error = Request.Query.Get("error");
string error = Request.Query["error"];
if (!string.IsNullOrWhiteSpace(error))
{
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "User requested error '{0}'", error));

View File

@ -4,6 +4,7 @@
using System.Collections.Generic;
using Microsoft.AspNet.Http;
using Microsoft.Framework.Primitives;
namespace Microsoft.AspNet.Diagnostics.Views
{
@ -38,14 +39,6 @@ namespace Microsoft.AspNet.Diagnostics.Views
/// Request headers.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Model class contains collection")]
public IDictionary<string, string[]> Headers { get; set; }
/* TODO:
/// <summary>
/// The request environment
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Model class contains collection")]
public HttpContext Environment { get; set; }
*/
public IDictionary<string, StringValues> Headers { get; set; }
}
}