httpHandlers path config limitation

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: httpHandlers path config limitation

    How about using httpmodule instead of httphandler?

    On 23 Jul 2003 11:58:45 -0700, Jason Chen <jason.chen@multex.com> wrote:
    > hello, when registering httpHandlers, I can specify a path to match,
    > like following:
    > <add verb="*" path="/secure/*.xml"
    > type="System.Web.HttpForbiddenHandler" />
    > this will protect all xml files under /secure directory.
    > but it will not protect xml files under subdirectories of /secure/
    > directory.
    > for example /secure/sub1/a.xml is not protected
    > changing the config to <add verb="*" path="/secure/*/*.xml"
    > type="System.Web.HttpForbiddenHandler" />
    > will result the server hanging, when .NET Framework matches path, it
    > just couldn't understand path="/secure/*/*.xml"
    > there are 3 work arounds I can think of, 1. specify each sub directory
    > respectively, as following
    > <add verb="*" path="/secure/sub1/*.xml"
    > type="System.Web.HttpForbiddenHandler" />
    > <add verb="*" path="/secure/sub2/*.xml"
    > type="System.Web.HttpForbiddenHandler" />
    > ....
    > this won't work out if you have many sub directories or if you
    > have dynamic sub directories generated.
    > 2. ignore the path, just register all xml files as following <add
    > verb="*" path="*.xml" type="System.Web.HttpForbiddenHandler" />
    > and in the handler, find out the path, do the path matching yourself,
    > using this solution, you have to serve files that you don't want to.
    >
    > any comments on this ?
    >


    --
    Using M2, Opera's revolutionary e-mail client: [url]http://www.opera.com/m2/[/url]
    Simen Guest

  2. Similar Questions and Discussions

    1. Custom HttpHandlers and Declarative Security
      Hello All, I am using maverick.net (a framework based around a custom httphandler in ASP.NET) and I'm trying to integrate declarative security...
    2. Error loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config
      I had many ASP.NET web applications that I created before I had to rebuild my machine. After a fresh install of XP Pro, VS.NET 2003, etc, I now...
    3. #25466 [Opn->Bgs]: PHP ignores --with-config-file-path compile option somehow?
      ID: 25466 Updated by: sniper@php.net Reported By: php-bugs-2003-09 at webfreezer dot com -Status: Open...
    4. #25466 [NEW]: PHP ignores --with-config-file-path compile option somehow?
      From: php-bugs-2003-09 at webfreezer dot com Operating system: Linux PHP version: 4.3.3 PHP Bug Type: PHP options/info...
    5. Using httpHandlers to allows access to mp3 files
      Hi there I need to allow users to download mp3 files after they have paid for them. Is it possible to use httpHandlers to control access to the...
  3. #2

    Default Re: httpHandlers path config limitation

    thanks for your reply.
    using a httpModule can do the trick as well, just like other
    workarounds,
    it's not how it suppose to work.

    I guess I'd like to question why microsoft introduced the path
    matching implementation like this, can't they just allow a simple
    regular expressiion
    matching here ?

    Simen <shagelid@hotmail.com> wrote in message news:<oprss25my9bfuc92@msnews.microsoft.com>...
    > How about using httpmodule instead of httphandler?
    >
    > On 23 Jul 2003 11:58:45 -0700, Jason Chen <jason.chen@multex.com> wrote:
    >
    Jason Chen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139