How do I add a http handler without ssl to my asp.net secure web app?

129 views Asked by At

I have an old asp.net (non-core, non-mvc) https webapp which has a number of IHttpHandlers which serve files using a setup in my web.config like so:

  <system.webServer>
    <handlers>
      <add name="DocumentAttachmentHandler"
           path="*/Secure/DocumentAttachment/*/*/*/*/*.*"
           type="[company].[product].WebApp.AttachmentHandlers.DocumentAttachmentHandler, [company].[product].WebApp"
           verb="GET"/>

I want to add a new handler that is localhost only (only accessible internally) and is http instead of https.

This is what I added:

      <add name="MyFileHandler"
           path="*/Public/My/*/*.*"
           type="[company].[product].WebApp.AttachmentHandlers.MyAttachmentHandler, [company].[product].WebApp"
           verb="GET" />

But my breakpoint in the handler doesn't hit when I call:

http://localhost:44300/[product]/Public/My/[fileId]/[filename].[ext]

...because my webapp is https. It does hit when I change my entire webapp to http, but I obviously can't leave it like that ;-)

I tried setting path="http://localhost:44300/[product]/Public/My/*/*.*" and adding allowPathInfo="true" ...but that didn't work.


All my web searches return telling me how to make something secure, when I want to make mine less secure (sort of).

Please can someone tell me how I should go about doing this?

0

There are 0 answers