ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | List of all members
ImageResizer.Plugins.Basic.Diagnostic Class Reference

Provides the incredibly helpful /resizer.debug page we all love. More...

Inheritance diagram for ImageResizer.Plugins.Basic.Diagnostic:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.Basic.Diagnostic:
Collaboration graph
[legend]

Public Member Functions

IPlugin Install (Configuration.Config c)
 
bool AllowResponse (HttpContext context)
 True if diagnostics can be displayed to the current user. If <diagnostics enableFor="None" />, returns false. If <diagnostics enableFor="Localhost" />, returns false for remote requests If <diagnostics enableFor="AllHosts" />, returns true. If unspecified, uses the same behavior as ASP.NET Custom Errors. More...
 
bool Uninstall (Configuration.Config c)
 
- Public Member Functions inherited from ImageResizer.Plugins.IPlugin
IPlugin Install (Config c)
 Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. More...
 
bool Uninstall (Config c)
 Uninstalls the plugin. Should reverse all changes made during Install More...
 

Detailed Description

Provides the incredibly helpful /resizer.debug page we all love.

Mimics the behavior of customErrors by default. Not available if CustomErrors=true or retail=true. Available only to localhost if customErrors=RemoteOnly. Can be overriden by adding in the <resizer> section <diagnostics enableFor="None|AllHosts|LocalHost" />

Definition at line 35 of file Diagnostic.cs.

Member Function Documentation

bool ImageResizer.Plugins.Basic.Diagnostic.AllowResponse ( HttpContext  context)
inline

True if diagnostics can be displayed to the current user. If <diagnostics enableFor="None" />, returns false. If <diagnostics enableFor="Localhost" />, returns false for remote requests If <diagnostics enableFor="AllHosts" />, returns true. If unspecified, uses the same behavior as ASP.NET Custom Errors.

Parameters
context
Returns

Definition at line 69 of file Diagnostic.cs.

69  {
70 
71  bool detailedErrors = !context.IsCustomErrorEnabled;
72  DiagnosticMode def = (detailedErrors) ? DiagnosticMode.AllHosts : DiagnosticMode.None;
73 
74  DiagnosticMode mode = c.get<DiagnosticMode>("diagnostics.enableFor", def);
75  if (mode == DiagnosticMode.None) return false;
76  if (mode == DiagnosticMode.AllHosts) return true;
77  return context.Request.IsLocal;
78 
79  }
DiagnosticMode
Determines when the diagnostics page can be viewed.
Definition: Diagnostic.cs:13

The documentation for this class was generated from the following file: