User-565895123 posted
Hi all,
Written a little handler to stop browsing to certain assets. I have a folder called 'assets' and I would like to route all requests for files within that directory or sub directories through the handler. I think I'm looking for the correct syntax for the
web.config HttpHandlers section.
Placing files within the root of assets and using:
<add verb="GET" path="assets/*.*" type="AssetShieldSite.AssetShield"/>
works fine but doesn't work when accessing a subdirectory of assets. Have tried
<add verb="GET" path="assets/*" type="AssetShieldSite.AssetShield"/>
which didn't work.
Sorry if this has been asked before but a good search didn't get me an answer.
(Note: adding all subdirectories involved to the web.config file is a non-starter for me as the application allows the admin to configure access to certain directories - and those directories will change - and the permissions scheme is not as simple as access
or not. So I'm looking for a way of passing any request from assets -> downwards, to the handler where it can then inspect the request and retreive permissions from the database to decide whether to allow access or not - based on certain criteria. The handler
itsself does all of this and works fine, it purely the mechanism of getting it to recognise any request within assets - no matter how deeply nested - that I need).
Thanks.