Setting custom header values in an IIS ISAPI filter

Posted by Jon Tackabury on Stack Overflow See other posts from Stack Overflow or by Jon Tackabury
Published on 2010-03-18T17:12:05Z Indexed on 2010/03/18 17:21 UTC
Read the original article Hit count: 794

Filed under:
|
|

I have an ISAPI filter that I am using to do URL rewriting for my CMS. I am processing SF_NOTIFY_PREPROC_HEADERS notifications, and trying to do this:

DWORD ProcessHeader(HTTP_FILTER_CONTEXT *con, HTTP_FILTER_PREPROC_HEADERS *head)
{
    head->SetHeader(con, "test1", "aaa");
    con->AddResponseHeaders(con, "test2:bbb\r\n", 0);
    return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

However, I can't seem to read these values using server variables or response headers in classic ASP or PHP. The values are missing. I'm expecting either my "test1" or "test2" header values to appear, but they are not. Am I doing something wrong here?

© Stack Overflow or respective owner

Related posts about c++

Related posts about isapi