Data exchange between extension and filter (extension -> filter) RRS feed

  • Question

  • User-1647875860 posted


     To keep a long story short: atm we got a filter module that inspects/alters headers AND body of requests on sending AND receiving to/from iis (read_raw, send_raw notifications). The problem now is that i need to get rid of the read_raw (no more IIS5 isolation mode, working SSL) handling in IIS6. It seems that the only way of doing this is using an extension (wildcard application mapping) to analyze/modify header and body and then pass it on with HSE_REQ_EXEC_URL. I still need the send_raw notification (in an filter) as i cant intercept the response in an extension. The problem now is that the response filtering depends on information gathered by the extension during the request analysation and i currently dont see a way of passing data from the request handler (extension) to the response handler (filter). I wonder if there actually is a way to do this?


    Tuesday, June 19, 2007 5:25 AM


  • User-75227868 posted

    Hhmn. Thats a tricky situation. If it was for IIS7 (and onwards) I would have suggested using a native\managed module to intercept request at RQ_BEGIN_REQUEST and response at RQ_SEND_RESPONSE.

    But if its for IIS6 then the only way you could pass something from your wilcard-scriptmap to your send_raw filter is by adding a custom request header (when inside of your wildcard-scriptmap) and reading that request header (when inside of send_raw filter) by making a call to GetServerVariable("HTTP_<yourheadername>");

    This approach has limitations. One I can readily recall is that there is only so much you could write in a header. And since a client can also send (read....spoof) request headers your isapi extension needs to be careful to first remove any occurence of that cutom header from the request before adding any of its own.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Wednesday, June 20, 2007 3:50 PM