Adding custom server variables from http module

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cybermedia Marketing

    #1

    Adding custom server variables from http module

    I'm trying to convert an ISAPI filter to an httpmodule. The ISAPI filter
    added custom headers to the response which could later be accessed by the
    asp page.

    ISAPI Filter:

    pvPrep->SetHeader(pf c, "Instance-Id:", info->instance_id) ;
    pvPrep->SetHeader(pf c, "Company-Id:", info->company_id);
    pvPrep->SetHeader(pf c, "Primary:", info->hostname);
    pvPrep->SetHeader(pf c, "Profile:", buffer);

    These could then be accessed in asp by calling:

    Request.serverv ariables("HTTP_ INSTANCE_ID")
    Request.serverv ariables("HTTP_ COMPANY_ID")
    Request.serverv ariables("HTTP_ PRIAMRY")
    Request.serverv ariables("HTTP_ PROFILE")


    I've tried adding headers to the response in my httpmodule with the
    following code:

    _app.Context.Re sponse.AddHeade r("INSTANCE-ID", instance_id)
    _app.Context.Re sponse.AddHeade r("COMPANY-ID", company_id)
    _app.Context.Re sponse.AddHeade r("PRIMARY", hostname)

    and when I view the headers in a tool like wfetch the headers are there but
    they can't be accessed thru the servervariables object in the resulting
    page.

    BTW, I did setup IIS to use the aspnet_isapi.dl l to process asp pages.

    Anybody have any thoughts or Ideas on how I can make this work or what I'm
    doing wrong?

    I can't use viewstate or session variables or anything like that due to the
    way the original asp app uses these variables.


Working...