[Moin-devel] CVS: MoinMoin cgimain.py,1.46,1.47

J?rgen Hermann jhermann at users.sourceforge.net
Mon Mar 11 13:49:06 EST 2002


Update of /cvsroot/moin/MoinMoin
In directory usw-pr-cvs1:/tmp/cvs-serv5352/MoinMoin

Modified Files:
	cgimain.py 
Log Message:
Rolled test.cgi into moin.cgi; show server environment only locally


Index: cgimain.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** cgimain.py	3 Mar 2002 09:24:36 -0000	1.46
--- cgimain.py	11 Mar 2002 21:48:48 -0000	1.47
***************
*** 40,43 ****
--- 40,48 ----
      print
  
+     # check if the request is a local one
+     import socket
+     local_request = socket.getfqdn(os.environ.get('SERVER_NAME')) == \
+         socket.getfqdn(os.environ.get('REMOTE_ADDR'))
+ 
      # check directories
      print "Checking directories..."
***************
*** 68,76 ****
          print 'Found an external diff: "%s"' % (string.strip(lines[0]),)
  
!     # print the environment, in case people use exotic servers with broken
!     # CGI APIs (say, M$ IIS), to help debugging those
      print "\nServer Environment:"
!     for key in os.environ.keys():
!         print "    %s = %s" % (key, repr(os.environ[key]))
  
  
--- 73,85 ----
          print 'Found an external diff: "%s"' % (string.strip(lines[0]),)
  
!     # keep some values to ourselves
      print "\nServer Environment:"
!     if local_request:
!         # print the environment, in case people use exotic servers with broken
!         # CGI APIs (say, M$ IIS), to help debugging those
!         for key in os.environ.keys():
!             print "    %s = %s" % (key, repr(os.environ[key]))
!     else:
!         print "    ONLY AVAILABLE FOR LOCAL REQUESTS ON THIS HOST!"
  
  





More information about the Moin-devel mailing list