IHttpHandler Path

G

Guest

I'm attempting to create my first HttpHandler but there seems to be a problem.

The handler works fine for the root directory and all sub directories.

That is.
http://localhost/handlerexample/
and
http://localhost/handlerexample/testdir

Works fine even if the directory does not exist.

My problem is with:
http://localhost/handlerexample

Note the / at the end is missing.

When I enter this path the application tries to do directory browsing.
and since this is not allocated in IIS for the Virtual a Security Exception
is raised.

How can I fix this problem?

Thanks
Jaco Roux
 
B

Brock Allen

This is an aspect of IIS and you can't really get it work work unless you
write an ISAPI filter, which isn't a lot of fun.
 
D

Dirc Khan-Evans

jaco said:
I'm attempting to create my first HttpHandler but there seems to be a
problem.

The handler works fine for the root directory and all sub directories.

That is.
http://localhost/handlerexample/
and
http://localhost/handlerexample/testdir

Works fine even if the directory does not exist.

My problem is with:
http://localhost/handlerexample

Note the / at the end is missing.

When I enter this path the application tries to do directory browsing.
and since this is not allocated in IIS for the Virtual a Security
Exception is raised.

How can I fix this problem?

Thanks
Jaco Roux

Do you have a default document set and does it exist? I think (guess
would be more accurate..) the HttpHandler pipeline will only work with
a document.. either requested explicitly by the client or via the
serving of a default document. If there is no document to serve, then
standard http protocol would be used.. ie there is no default document
and you cannot browse.

Dirc

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top