[Mono-dev] [PATCH] Add HttpNotFoundHandler and HttpNotImplementedHandler

Marek Habersack grendel at twistedcode.net
Mon Nov 2 03:39:20 EST 2009


Kornél Pál wrote:
> Miguel de Icaza wrote:
>>      I am not sure why we would include in Mono two classes that are 
>> flagged as internal.   How would a user even use this?
> 
> Handlers are mostly used in Web.config and the ASP.NET runtime uses 
> reflection that makes it able to instantiate non-public types. This way 
> users may not even realize that they are using internal types.
True, but this is not the case for the two types you implemented.

> On the other hand if you want to hide or deny requests you can use just 
> like HttpForbiddenHandler but you can have additional HTTP status codes 
> and messages.
> 
> Of course you could duplicate this functionality in your own classes but 
> it's easier to use existing framework classes.
That's what we do now.

> I just realized that Microsoft documented HttpForbiddenHandler that is 
> internal as well and is implemented in Mono:
> http://msdn.microsoft.com/en-us/library/ms404282.aspx
> 
> Originally HttpForbiddenHandler was exposed only in Web.config.
> HttpNotFoundHandler existed in 1.x but was not exposed in Web.config 
> until 2.0.
Ah, indeed, just looked at .NET 3.5 config and it's there. I'm ok with putting in System.Web in that 
case (modify the global web.config as well, to reference the type in the same fashion as .NET)

> So people most likely know that these types exist and the might use 
> them. I actually wanted to use it when I found out that we haven't had it.
That, in itself, is not a good argument - most Windows developers who work with .NET probably use 
Reflector to dig into .NET internals, so they are aware of many internal types/fields/methods - we 
won't implement features based on that knowledge, at least I don't think it's a good idea.

> HttpNotImplementedHandler is not used in Web.config and is most likely 
> known by much less people but I found it in the prevously referenced 
> book so I just implemented that as well to make the internal simple 
> handler collection complete.
I don't think we should include it just for the sake of it. If you want it in, that's fine, but you 
need to modify all the spots in System.Web code which throw 404 and make sure there are no 
regressions in exception/error handling because of that. Only then the type can be included.

marek

> 
> Kornél
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 



More information about the Mono-devel-list mailing list