diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/ElmPageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics.Elm/ElmPageMiddleware.cs index 50f3838493..33f94e9585 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/ElmPageMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics.Elm/ElmPageMiddleware.cs @@ -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; } } diff --git a/src/Microsoft.AspNet.Diagnostics/ErrorHandlerMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/ErrorHandlerMiddleware.cs index 42a661569f..1464f3e3d1 100644 --- a/src/Microsoft.AspNet.Diagnostics/ErrorHandlerMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics/ErrorHandlerMiddleware.cs @@ -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); } } diff --git a/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs index a96bc09294..c7bc2f36e7 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs +++ b/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs @@ -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)); diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPageModel.cs b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPageModel.cs index de93646abf..5234c0cea5 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPageModel.cs +++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPageModel.cs @@ -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. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Model class contains collection")] - public IDictionary Headers { get; set; } - - /* TODO: - /// - /// The request environment - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Model class contains collection")] - public HttpContext Environment { get; set; } - */ + public IDictionary Headers { get; set; } } }