Changeset 54:2b5576bea19a

Show
Ignore:
Timestamp:
12/05/06 14:11:04 (2 years ago)
Author:
Allan Saddi <allan@saddi.com>
branch:
default
convert_revision:
svn:46762da8-4eb7-0310-94e9-d918b60927c8/flup/trunk@2188
Message:

Update servers to default to an empty QUERY_STRING if
not present in the environ.

Update gzip.py: compresslevel -> compress_level

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r53 r54  
    112006-12-05  Allan Saddi  <asaddi@sahara.flup.org> 
     2 
     3        * Update servers to default to an empty QUERY_STRING if 
     4          not present in the environ. 
     5 
     6        * Update gzip.py: compresslevel -> compress_level 
    27 
    38        * Update gzip.py by updating docstrings and renaming 
  • flup/middleware/gzip.py

    r53 r54  
    122122    """ 
    123123 
    124     def __init__(self, start_response, mime_types, compresslevel): 
     124    def __init__(self, start_response, mime_types, compress_level): 
    125125        self._start_response = start_response 
    126126        self._mime_types = mime_types 
     
    132132        self._crc = zlib.crc32('') 
    133133        self._size = 0 
    134         self._compress = zlib.compressobj(compresslevel, 
     134        self._compress = zlib.compressobj(compress_level, 
    135135                                          zlib.DEFLATED, 
    136136                                          -zlib.MAX_WBITS, 
     
    207207    """ 
    208208 
    209     def __init__(self, application, mime_types=None, compresslevel=9): 
     209    def __init__(self, application, mime_types=None, compress_level=9): 
    210210        """Initializes this GzipMiddleware. 
    211211 
     
    215215            specified. 
    216216 
    217         ``compresslevel`` 
     217        ``compress_level`` 
    218218            The gzip compression level, an integer from 1 to 9; 1 is the 
    219219            fastest and produces the least compression, and 9 is the slowest, 
     
    225225        self._application = application 
    226226        self._mime_types = [re.compile(m) for m in mime_types] 
    227         self._compresslevel = compresslevel 
     227        self._compress_level = compress_level 
    228228 
    229229    def __call__(self, environ, start_response): 
     
    236236        # All of the work is done in _GzipMiddleware and _GzipIterWrapper. 
    237237        g = _GzipMiddleware(start_response, self._mime_types, 
    238                             self._compresslevel) 
     238                            self._compress_level) 
    239239 
    240240        result = self._application(environ, g.start_response) 
  • flup/server/ajp.py

    r52 r54  
    194194              '</body></html>\n' 
    195195 
     196    from wsgiref import validate 
     197    test_app = validate.validator(test_app) 
    196198    # Explicitly set bindAddress to *:8009 for testing. 
    197199    WSGIServer(test_app, 
  • flup/server/ajp_base.py

    r37 r54  
    925925        environ['SCRIPT_NAME'] = scriptName 
    926926 
     927        if not environ.has_key('QUERY_STRING'): 
     928            environ['QUERY_STRING'] = '' 
     929 
    927930    def error(self, request): 
    928931        """ 
  • flup/server/ajp_fork.py

    r52 r54  
    192192              '</body></html>\n' 
    193193 
     194    from wsgiref import validate 
     195    test_app = validate.validator(test_app) 
    194196    # Explicitly set bindAddress to *:8009 for testing. 
    195197    WSGIServer(test_app, 
  • flup/server/fcgi.py

    r52 r54  
    148148              '</body></html>\n' 
    149149 
     150    from wsgiref import validate 
     151    test_app = validate.validator(test_app) 
    150152    WSGIServer(test_app).run() 
  • flup/server/fcgi_base.py

    r41 r54  
    11351135        if not environ.has_key('PATH_INFO'): 
    11361136            environ['PATH_INFO'] = '' 
     1137        if not environ.has_key('QUERY_STRING'): 
     1138            environ['QUERY_STRING'] = '' 
    11371139 
    11381140        # If any of these are missing, it probably signifies a broken 
  • flup/server/fcgi_fork.py

    r52 r54  
    163163              '</body></html>\n' 
    164164 
     165    from wsgiref import validate 
     166    test_app = validate.validator(test_app) 
    165167    WSGIServer(test_app).run() 
  • flup/server/scgi.py

    r52 r54  
    189189              '</body></html>\n' 
    190190 
     191    from wsgiref import validate 
     192    test_app = validate.validator(test_app) 
    191193    WSGIServer(test_app, 
    192194               loggingLevel=logging.DEBUG).run() 
  • flup/server/scgi_base.py

    r47 r54  
    493493        environ['SCRIPT_NAME'] = scriptName 
    494494 
     495        if not environ.has_key('QUERY_STRING'): 
     496            environ['QUERY_STRING'] = '' 
     497 
    495498    def error(self, request): 
    496499        """ 
  • flup/server/scgi_fork.py

    r52 r54  
    187187              '</body></html>\n' 
    188188 
     189    from wsgiref import validate 
     190    test_app = validate.validator(test_app) 
    189191    WSGIServer(test_app, 
    190192               loggingLevel=logging.DEBUG).run()