handle CGI Request - client address parameters - error and gotcha
handle CGI Request - client address parameters - error and gotcha
- Subject: handle CGI Request - client address parameters - error and gotcha
- From: email@hidden
- Date: Thu, 14 Jun 2001 04:25:25 EDT
The dictionary entry for the handle CGI request of standard additions has an
error, and the behavior of the parameters involved may present a "gotcha" if
you don't know certain facts.
-- the error part ----
(9.1+1.5.5/1.6, but probably applies to earlier versions).
Here is the abbreviated Standard Additions dictionary entry...
handle CGI request: Sent to a script to process a Common Gateway Interface
request
handle CGI request string -- the path of the URL
[from address string] -- the IP address of the entity making the
request
[from client IP address string] -- the Internet address of the
client
It appears that the definitions are switched. "address" should be the
canonical name of the browsing computer, not the IP address, and "client IP
address" should be... well, you've got the point.
Chris Nebel - is there time to sneak the dictionary fix into macOS 9.2? TIA.
-- the "gotcha" part ---
When run thru Personal Web Sharing in classic, these are both set to the IP
address of the browsing computer. The canonical name is not delivered to the
CGI by PWS.
When run thru WebSTAR, the behavior varies depending on the setting of the
"Use DNS for server and client IP lookups" checkbox (found under Web Settings
--> Connections in WebSTAR Admin).
If "Use DNS..." is checked, "address" is delivered to the CGI as the
canonical name of the browsing computer.
If "Use DNS..." is unchecked, "address" arrives as the IP address of the
browsing computer.
This can cause problems when writing CGIs which use this info, especially
when moved to other servers where the setting may be different (or when an
administrator changes the settings without telling the CGI writer). Starnine
oops 4D recommends turning "Use DNS..." OFF for best speed, but it must be ON
if one uses canonical names in the allow/deny settings for realms, so either
setting is likely to be encountered.
I don't know how this might apply to other server software on the Mac. I hope
this info helps someone.
cc please, on digest
Jeff Baumann
email@hidden
www.linkedresources.com