I think that Apache does NOT pass certain environment variables through to
CGI programs (and by extension, to application servers such as Webware.  You
can override this behavior by including lines like the following in
httpd.conf:

PassEnv HTTP_HOST REMOTE_ADDR HTTP_REFERER

This should pass the three you mentioned below.

Cheers!
--
David Hancock | [EMAIL PROTECTED] | 410-266-4384


-----Original Message-----
From: Tracy S. Ruggles [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 1:26 PM
To: Webware Discuss
Subject: [Webware-discuss] os.environ oddities...


Hi all,

This is only slightly related to Webware, but I've got something odd 
when trying to access data in os.environ:

Here's my page:

> import os
> from WebKit.Page import Page
>
> class environ(Page):
>       def writeContent(self):
>               attrs = os.environ.keys()
>               attrs.sort()
>               self.write('<ul>\n')
>               for attr in attrs:
>                       self.write('<li><b>%s</b>: %s</li>\n' % (attr,
os.environ[attr]))
>               self.write('</ul>\n')

But this shows none of the regular information such as 'REMOTE_ADDR', 
'HTTP_HOST', 'HTTP_REFERER', etc.  Has anyone had this happen to them?  
I do get a 'REMOTEHOST' variable which shows what 'REMOTE_ADDR' used to 
show...

        [ Webware 0.8.1 / mod_webkit 0.5 / Python 2.2.3  / Apache 1.3.27 ]

Thanks,
Tracy


P.S.  The standard printenv perl script *does* show all the proper 
information:

#!/usr/bin/perl
##
##  printenv -- demo CGI program which just prints its environment
##

print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
     $val = $ENV{$var};
     $val =~ s|\n|\\n|g;
     $val =~ s|"|\\"|g;
     print "${var}=\"${val}\"\n";
}



-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to