diff options
Diffstat (limited to 'mcs/class/System.Web/System.Web.Handlers')
-rw-r--r-- | mcs/class/System.Web/System.Web.Handlers/ChangeLog | 9 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs | 30 |
2 files changed, 34 insertions, 5 deletions
diff --git a/mcs/class/System.Web/System.Web.Handlers/ChangeLog b/mcs/class/System.Web/System.Web.Handlers/ChangeLog index ebddbc1e4ba..4f3e185e220 100644 --- a/mcs/class/System.Web/System.Web.Handlers/ChangeLog +++ b/mcs/class/System.Web/System.Web.Handlers/ChangeLog @@ -1,3 +1,12 @@ +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. + 2004-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TraceHandler.cs: Added protected missing members and attributes. diff --git a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs index 33385dbf5fb..23e35288f80 100644 --- a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs +++ b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs @@ -39,17 +39,37 @@ using System.Web.UI.WebControls; namespace System.Web.Handlers { +#if NET_2_0 + [Serializable] +#endif + class TraceNotAvailableException : HttpException + { + bool notLocal; + + public TraceNotAvailableException (bool notLocal) : + base (notLocal ? 403 : 500, "Trace Error") + { + this.notLocal = notLocal; + } + + internal override string Description { + get { + if (notLocal) + return "Trace is not enabled for remote clients."; + + return "Trace.axd is not enabled in the configuration file for this application."; + } + } + } + public class TraceHandler : IHttpHandler { void IHttpHandler.ProcessRequest (HttpContext context) { TraceManager manager = HttpRuntime.TraceManager; - if (manager.LocalOnly && !context.Request.IsLocal) { - // Need to figure out the error message that goes here - // but I only have cassini for testing - return; - } + if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) + throw new TraceNotAvailableException (manager.Enabled); HtmlTextWriter output = new HtmlTextWriter (context.Response.Output); |