Solved

GetServerVariable or GetHeader?

Posted on 2006-07-10
5
316 Views
Last Modified: 2013-11-20
Hi,

Im making an ISAPI filter and i need to check the value of HTTP HEADER - "HTTP_X_UP_SUBNO" which is a header which WAP phones use.

Im using -

if (pCtxt->GetServerVariable("HTTP_X_UP_SUBNO", szAddress, &dwSize))
{
// do something
}
else
{
//failed
}

it always goes into the failed code with GetLastError returning ERROR_INVALID_INDEX.

Am i using the wrong function? GetHeader doesnt seem to work either.

Ive done a server variables dump in ASP and i definately have the 'HTTP_X_UP_SUBNO' header and it has a value but still i get ERROR_INVALID_INDEX.
0
Comment
Question by:x2cmsac
  • 2
5 Comments
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17075278
Is this the case with u  : http://support.microsoft.com/default.aspx?scid=kb;en-us;294217 <=

-MAHESH
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 500 total points
ID: 17075328
As said any underscore ( _ ) that follows "HTTP_" is incorrectly converted to a dash when IIS attempts to retrieve the custom header value for the variable, and therefore, the variable is not found.

So resolve this you :

Do not use an underscore in the custom HTTP header variable name.

-OR-

Retrieve and parse the HTTP_ALL header variable for the custom HTTP header variable.


-MAHESH
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question