FastCGI authorizer and env variables
Yalcin Bozcaada (bozcaada@OpenMarket.com)
Tue, 11 Feb 1997 18:39:47 -0500
Message-Id: <1.5.4.32.19970211233947.0094e4b0@mail-60.openmarket.com>
Date: Tue, 11 Feb 1997 18:39:47 -0500
To: fastcgi-developers@OpenMarket.com
From: Yalcin Bozcaada <bozcaada@OpenMarket.com>
Subject: FastCGI authorizer and env variables
I am not sure if anyone answered this question. If this is a repeat, sorry.
John was asking:
> >
> >Why aren't the following environment variables sent to the fast-cgi
> >authorizer
> >process:???
> >
> > PATH_INFO
> > PATH_TRANSLATED
The answer is: They are sent. In your FastCGI authorizer program you will
normally access them with getenv("PATH_INFO") and getenv("PATH_TRANSLATED").
What are you trying to do and can't access them?
Yet, if you are authorizing a CGI program and you want to pass a PATH_INFO
to it even when you don't have one, you can do that by sending
Variable-PATH_INFO to the CGI program.
for example: This is your authorizer FastCGI program.
char *pinfo = getenv("PATH_INFO");
char *ptran = getenv("PATH_TRANSLATED");
.
. (some code)
.
if( pinfo == NULL ) pinfo = "/Ads/General";
if( ptran == NULL ) ptran = "myprog/Ads/General";
printf("Status: 200 OK\r\n"
"Variable-AUTH_TYPE: Digest\r\n"
"Variable-REMOTE_PASSWD:\r\n"
"Variable-PATH_INFO: %s\r\n"
"Variable-PATH_TRANSLATED: %s\r\n"
"\r\n", pinfo,ptran );
regards.
-yalcin Bozcaada
*----------------------------------------------------------------*
*- yalcin Bozcaada -*
*- Open Market Inc. "The Internet Commerce Company" -*
*- 245 First Street, Cambridge, MA 02142 USA -*
*- www.openmarket.com -*
*- Phone: +1 617 949 7543 -*
*- TECHNICALLY STRONG TECHNICAL SUPPORT -*
*- -*
*- My opinions are mine and you know the rest! -*
*- Work like you'll never die and -*
*- have fun like you'll die tomorrow. -*
*----------------------------------------------------------------*