From: Rob McCool 
Newsgroups: netscape.devs-nsapi
Subject: Re: Path lookups in CGI's...
Date: Wed, 27 Nov 1996 17:00:51 -0800

William Bardwell wrote:
> 
> So, how does the CGI stuff (send-cgi I suppose) do the path lookups to
> fill in PATH_TRANSLATED, and how do I get at the same stuff...and how
> come
> it doesn't seem to be equivilent to running all the PathTrans stuff...
> (eg a custom path translator doesn't happen right.)

It uses the function request_translate_uri(), which in the 2.x servers is called servact_translate_uri(). Here's the prototype:

/*
 * Returns the translated path (filename) for the given uri, NULL otherwise.
 * If authentication is required for the given uri, nothing is returned even
 * if the current user has authenticated to that area.
 */
NSAPI_PUBLIC char *servact_translate_uri(char *uri, Session *sn);

(In the 1.x servers, replace servact with request).

So if you call it with "/foo" it will run the NameTrans functions with 
"/foo" as the ppath entry.

--Rob

--
Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/
Stunt Programmer, Netscape Communications Corporation
It was working ten minutes ago, I swear...
Reproduced by permission of the author.