Adding custom server variables from http module

  • Thread starter Cybermedia Marketing
  • Start date
C

Cybermedia Marketing

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(pfc, "Instance-Id:", info->instance_id);
pvPrep->SetHeader(pfc, "Company-Id:", info->company_id);
pvPrep->SetHeader(pfc, "Primary:", info->hostname);
pvPrep->SetHeader(pfc, "Profile:", buffer);

These could then be accessed in asp by calling:

Request.servervariables("HTTP_INSTANCE_ID")
Request.servervariables("HTTP_COMPANY_ID")
Request.servervariables("HTTP_PRIAMRY")
Request.servervariables("HTTP_PROFILE")


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

_app.Context.Response.AddHeader("INSTANCE-ID", instance_id)
_app.Context.Response.AddHeader("COMPANY-ID", company_id)
_app.Context.Response.AddHeader("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.dll 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top