diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-10-06 09:47:21 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-10-06 09:47:21 +0400 |
commit | 4ef99e858b96be0cb0bc02965173ec785755846b (patch) | |
tree | 18aa38dd8d7fe32198d9b7d408f031c93f68498b | |
parent | 1aed6001de1cb2f78c931fedfcc9dc5df7ac050b (diff) |
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.
svn path=/branches/mono-1-0/mcs/; revision=34751
-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); |