From 6e5c0b3e7e6a32db5535c26890897058f484ed5c Mon Sep 17 00:00:00 2001 From: Duncan Smart Date: Wed, 25 Sep 2013 18:26:03 +0100 Subject: [PATCH 1/2] Fixes #267 404 when request is not local. routes.axd should only be accessible in development. --- src/AttributeRouting.Web/Logging/LogRoutesHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs b/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs index 9e7472a..8031f9d 100644 --- a/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs +++ b/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs @@ -50,6 +50,12 @@ public bool IsReusable public void ProcessRequest(HttpContext context) { + if (context.Request.IsLocal) + { + context.Response.StatusCode = 404; + return; + } + var writer = context.Response.Output; var output = GetOutput(); From 4369a81e5ca511484d2ae50b856cb1c2f3a32234 Mon Sep 17 00:00:00 2001 From: Duncan Smart Date: Wed, 25 Sep 2013 18:37:10 +0100 Subject: [PATCH 2/2] derp: wrong way round --- src/AttributeRouting.Web/Logging/LogRoutesHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs b/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs index 8031f9d..dedde35 100644 --- a/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs +++ b/src/AttributeRouting.Web/Logging/LogRoutesHandler.cs @@ -50,7 +50,7 @@ public bool IsReusable public void ProcessRequest(HttpContext context) { - if (context.Request.IsLocal) + if (!context.Request.IsLocal) { context.Response.StatusCode = 404; return;