Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1586

Show
Ignore:
Timestamp:
01/05/07 09:37:17
Author:
lawouach
Message:

Fix for #635

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_wsgiapps.py

    r1411 r1586  
    2020            output.append('%s: %s\n' % (k,environ[k])) 
    2121        return output 
     22 
     23    def test_empty_string_app(environ, start_response): 
     24        status = '200 OK' 
     25        response_headers = [('Content-type', 'text/plain')] 
     26        start_response(status, response_headers) 
     27        return ['Hello', '', ' ', '', 'world'] 
    2228     
    2329    def reversing_middleware(app): 
     
    5157    cherrypy.tree.mount(HostedWSGI(), '/hosted/app0', conf0) 
    5258    cherrypy.tree.graft(test_app, '/hosted/app1') 
     59    cherrypy.tree.graft(test_empty_string_app, '/hosted/app3') 
    5360     
    5461    # Set script_name explicitly to None to signal CP that it should 
     
    9299        self.assertInBody(body) 
    93100 
     101    def test_06_empty_string_app(self): 
     102        self.getPage("/hosted/app3") 
     103        self.assertHeader("Content-Type", "text/plain") 
     104        self.assertInBody('Hello world') 
     105 
    94106if __name__ == '__main__': 
    95107    setup_server() 
  • trunk/cherrypy/wsgiserver.py

    r1565 r1586  
    415415            self.sent_headers = True 
    416416            self.send_headers() 
    417         if self.chunked_write
     417        if self.chunked_write and len(chunk)
    418418            buf = [hex(len(chunk))[2:], 
    419419                   "\r\n", chunk, "\r\n"] 

Hosted by WebFaction

Log in as guest/cpguest to create tickets