Changeset 15:fdeee42dffd9

Show
Ignore:
Timestamp:
05/18/05 16:13:01 (3 years ago)
Author:
Allan Saddi <allan@saddi.com>
branch:
default
convert_revision:
svn:46762da8-4eb7-0310-94e9-d918b60927c8/flup/trunk@1787
Message:

Change default allowedServers for ajp and scgi to 127.0.0.1?.
Accept PATH_INFO from environment for scgi servers, in case
cgi2scgi is being used.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r14 r15  
    112005-05-18  Allan Saddi  <asaddi@ganymede.saddi.net> 
    22 
     3        * Change default allowedServers for ajp and scgi to ['127.0.0.1']. 
     4        * Accept PATH_INFO from environment for scgi servers, in case 
     5          cgi2scgi is being used. Submitted by Ian Bicking. 
    36        * Change threaded servers so wsgi.multiprocess is False by default. 
    47          Allow it to be changed by keyword argument. 
  • flup/server/ajp_base.py

    r14 r15  
    4343 
    4444__all__ = ['BaseAJPServer'] 
     45 
     46class NoDefault(object): 
     47    pass 
    4548 
    4649# Packet header prefixes. 
     
    759762    def __init__(self, application, scriptName='', environ=None, 
    760763                 multithreaded=True, multiprocess=False, 
    761                  bindAddress=('localhost', 8009), allowedServers=None
     764                 bindAddress=('localhost', 8009), allowedServers=NoDefault
    762765                 loggingLevel=logging.INFO): 
    763766        """ 
     
    782785        allowedServers must be None or a list of strings representing the 
    783786        IPv4 addresses of servers allowed to connect. None means accept 
    784         connections from anywhere. 
     787        connections from anywhere. By default, it is a list containing 
     788        the single item '127.0.0.1'. 
    785789 
    786790        loggingLevel sets the logging level of the module-level logger. 
     
    795799        self.multiprocess = multiprocess 
    796800        self._bindAddress = bindAddress 
     801        if allowedServers is NoDefault: 
     802            allowedServers = ['127.0.0.1'] 
    797803        self._allowedServers = allowedServers 
    798804 
  • flup/server/scgi_base.py

    r14 r15  
    4444__all__ = ['BaseSCGIServer'] 
    4545 
     46class NoDefault(object): 
     47    pass 
     48 
    4649# The main classes use this name for logging. 
    4750LoggerName = 'scgi-wsgi' 
     
    270273    def __init__(self, application, scriptName='', environ=None, 
    271274                 multithreaded=True, multiprocess=False, 
    272                  bindAddress=('localhost', 4000), allowedServers=None
     275                 bindAddress=('localhost', 4000), allowedServers=NoDefault
    273276                 loggingLevel=logging.INFO): 
    274277        """ 
     
    293296        allowedServers must be None or a list of strings representing the 
    294297        IPv4 addresses of servers allowed to connect. None means accept 
    295         connections from anywhere. 
     298        connections from anywhere. By default, it is a list containing 
     299        the single item '127.0.0.1'. 
    296300 
    297301        loggingLevel sets the logging level of the module-level logger. 
     
    306310        self.multiprocess = multiprocess 
    307311        self._bindAddress = bindAddress 
     312        if allowedServers is NoDefault: 
     313            allowedServers = ['127.0.0.1'] 
    308314        self._allowedServers = allowedServers 
    309315 
     
    439445        # Namely SCRIPT_NAME/PATH_INFO 
    440446        value = environ['SCRIPT_NAME'] 
     447        # Pull PATH_INFO from environ, if it exists. (cgi2scgi actually 
     448        # passes it in.) 
     449        value += environ.get('PATH_INFO', '') 
    441450        scriptName = self.scriptName 
    442451        if not value.startswith(scriptName):