Skip to content
Browse files

Fixed a bug in checking the content type

  • Loading branch information...
1 parent d31deff commit 893eaa665a06e3f67c4dedb04f7bc47823dd8b64 @Haacked committed
Showing with 7 additions and 7 deletions.
  1. +5 −5 src/RouteDebug/DebugHttpHandler.cs
  2. +2 −2 src/RouteDebug/Properties/AssemblyInfo.cs
View
10 src/RouteDebug/DebugHttpHandler.cs
@@ -22,7 +22,7 @@ public void ProcessRequest(HttpContext context)
{
var request = context.Request;
- if (!IsRoutedRequest(request) || !request.ContentType.Equals("text/html", StringComparison.OrdinalIgnoreCase))
+ if (!IsRoutedRequest(request) || context.Response.ContentType == null || !context.Response.ContentType.Equals("text/html", StringComparison.OrdinalIgnoreCase))
{
return;
}
@@ -109,14 +109,14 @@ public void ProcessRequest(HttpContext context)
</div>";
string routeDataRows = string.Empty;
- RouteData routeData = requestContext.RouteData;
- RouteValueDictionary routeValues = routeData.Values;
- RouteBase matchedRouteBase = routeData.Route;
+ var routeData = requestContext.RouteData;
+ var routeValues = routeData.Values;
+ var matchedRouteBase = routeData.Route;
string routes = string.Empty;
using (RouteTable.Routes.GetReadLock())
{
- foreach (RouteBase routeBase in RouteTable.Routes)
+ foreach (var routeBase in RouteTable.Routes)
{
bool matchesCurrentRequest = (routeBase.GetRouteData(requestContext.HttpContext) != null);
string matchText = string.Format(@"<span{0}>{1}</span>", BoolStyle(matchesCurrentRequest), matchesCurrentRequest);
View
4 src/RouteDebug/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.1.2.0")]
-[assembly: AssemblyFileVersion("2.1.2.0")]
+[assembly: AssemblyVersion("2.1.3.0")]
+[assembly: AssemblyFileVersion("2.1.3.0")]

0 comments on commit 893eaa6

Please sign in to comment.
Something went wrong with that request. Please try again.