+2009-05-14 Marek Habersack <mhabersack@novell.com>
+
+ * HandlerFactoryConfiguration.cs: if we're matching a default
+ handler, disallow caching.
+
2009-01-08 Gert Driesen <drieseng@users.sourceforge.net>
* HandlerFactoryConfiguration.cs: Allow handlers with non-public
return false;
}
- public object LocateHandler (string verb, string filepath)
+ public object LocateHandler (string verb, string filepath, out bool allowCache)
{
int start, end;
int count = handlers.Count;
HttpHandler handler = (HttpHandler) handlers [i];
if (handler.Verbs == null){
- if (handler.PathMatches (filepath))
+ if (handler.PathMatches (filepath)) {
+ allowCache = handler.OriginalPath != "*";
return handler.GetHandlerInstance ();
+ }
continue;
}
j--;
if (verbs [j] != verb)
continue;
- if (handler.PathMatches (filepath))
+ if (handler.PathMatches (filepath)) {
+ allowCache = handler.OriginalPath != "*";
return handler.GetHandlerInstance ();
+ }
}
}
}
+ allowCache = false;
return null;
}
}
+2009-05-14 Marek Habersack <mhabersack@novell.com>
+
+ * HttpHandlersSection.cs: if we're matching a default handler,
+ disallow caching.
+
2009-04-03 Marek Habersack <mhabersack@novell.com>
* WebConfigurationManager.cs: added code in the static constructor
}
#region CompatabilityCode
- internal object LocateHandler (string verb, string filepath)
+ internal object LocateHandler (string verb, string filepath, out bool allowCache)
{
int top = Handlers.Count;
-
+
for (int i = 0; i < top; i++){
HttpHandlerAction handler = (HttpHandlerAction) Handlers [i];
string[] verbs = handler.Verbs;
if (verbs == null){
- if (handler.PathMatches (filepath))
+ if (handler.PathMatches (filepath)) {
+ allowCache = handler.Path != "*";
return handler.GetHandlerInstance ();
+ }
continue;
}
j--;
if (verbs [j] != verb)
continue;
- if (handler.PathMatches (filepath))
+ if (handler.PathMatches (filepath)) {
+ allowCache = handler.Path != "*";
return handler.GetHandlerInstance ();
+ }
}
}
+ allowCache = false;
return null;
}
#endregion
+2009-05-14 Marek Habersack <mhabersack@novell.com>
+
+ * HttpApplication.cs: LocateHandler won't cache if a default
+ handler was returned.
+
2009-05-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
* MimeTypes.cs: add silverlight related types.
if (ret != null)
return ret;
-
+
+ bool allowCache;
#if NET_2_0
HttpHandlersSection httpHandlersSection = (HttpHandlersSection) WebConfigurationManager.GetWebApplicationSection ("system.web/httpHandlers");
- ret = httpHandlersSection.LocateHandler (verb, url);
+ ret = httpHandlersSection.LocateHandler (verb, url, out allowCache);
#else
HandlerFactoryConfiguration factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");
- ret = factory_config.LocateHandler (verb, url);
+ ret = factory_config.LocateHandler (verb, url, out allowCache);
#endif
IHttpHandler handler = ret as IHttpHandler;
- if (handler != null && handler.IsReusable)
+ if (allowCache && handler != null && handler.IsReusable)
cache [id] = ret;
return ret;
object o = LocateHandler (verb, url);
factory = o as IHttpHandlerFactory;
-
if (factory == null) {
handler = (IHttpHandler) o;
} else {