diff options
-rw-r--r-- | mcs/class/System.Web/System.Web.Handlers/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs | 21 |
2 files changed, 20 insertions, 6 deletions
diff --git a/mcs/class/System.Web/System.Web.Handlers/ChangeLog b/mcs/class/System.Web/System.Web.Handlers/ChangeLog index 50459bd9024..4f3e185e220 100644 --- a/mcs/class/System.Web/System.Web.Handlers/ChangeLog +++ b/mcs/class/System.Web/System.Web.Handlers/ChangeLog @@ -1,3 +1,8 @@ +2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * TraceHandler.cs: error code is 403 and the message different when + trace is enabled but not for remote clients. + 2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TraceHandler.cs: check that trace is enabled or throw. diff --git a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs index 343aa5957a7..23e35288f80 100644 --- a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs +++ b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs @@ -44,11 +44,21 @@ namespace System.Web.Handlers #endif class TraceNotAvailableException : HttpException { - public TraceNotAvailableException () : - base ("Trace Error") {} + bool notLocal; + + public TraceNotAvailableException (bool notLocal) : + base (notLocal ? 403 : 500, "Trace Error") + { + this.notLocal = notLocal; + } internal override string Description { - get { return "Trace.axd is not enabled in the configuration file for this application."; } + get { + if (notLocal) + return "Trace is not enabled for remote clients."; + + return "Trace.axd is not enabled in the configuration file for this application."; + } } } @@ -58,9 +68,8 @@ namespace System.Web.Handlers { TraceManager manager = HttpRuntime.TraceManager; - if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) { - throw new TraceNotAvailableException (); - } + if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) + throw new TraceNotAvailableException (manager.Enabled); HtmlTextWriter output = new HtmlTextWriter (context.Response.Output); |