[Mono-list] IHttpHandler works fine under IIS but not Apache

Mike Christensen imaudi at comcast.net
Thu Apr 2 23:24:23 EDT 2009


Hi guys - I'm thinking this is most likely either an Apache limitation, 
a configuration problem, or a bug in mod-mono.  I'm hoping it's the 
latter so we can fix it :)

Let's say I have an IHttpHandler:

public class Handler : IHttpHandler
{
//Stuff here that will blow your mind
}


Now I register this in my web.config:

<httpHandlers>
  <add verb="*" path="*.foo" validate="false" type="Handler" />
</httpHandlers>

Good so far right?

When I go to:

/Test.foo

My handler will be invoked and it will do all sorts of great things that 
you simply can't imagine, probably change the world and all.

However if I do:

/Blah/Test.foo

Then Apache gives me a default 404 File not found error.

If I go and create a blank directory on the file system called Blah, 
things will then work again.  The point is, I do not want Apache or 
anything else validating the filepath or directory structure.  Keep in 
mind there's web apps such as SharePoint that allow you to provision 
webs, subwebs, etc and these paths are completely resolved by HTTP 
handlers and are totally independent of the filesystem.  Porting this 
architecture over to Mono might cause problems.

My question is what is actually to blame?  Is Apache verifying the 
directory before passing the request off to mod_mono?  It obviously 
doesn't validate the file itself since Test.foo doesn't exist anywhere 
on the filesystem.  I kinda think so because it's an Apache 404 error 
page I'm getting, which depresses me.  Also, this doesn't happen on xsp 
so I blame Apache.  Anything I can do about this?

On my app, I can hack around it by creating the directories or maybe 
doing some hacks with vdirs and stuff, but is there a way we can provide 
a better experience?  Thanks!!

Mike


More information about the Mono-list mailing list