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

Ticket #588: _cpwsgiserver.py_r1405_ticket588.diff

  • cherrypy/_cpwsgiserver.py

    old new  
    4545    'vary', 'via', 'warning', 'www-authenticate', 
    4646    ] 
    4747 
     48# RFC 2616: These response codes MUST NOT contain a message body 
     49NO_BODY_CODES = ("204", "304") 
    4850 
    4951class HTTPRequest(object): 
    5052     
     
    323325            and (# Request Entity Too Large. Close conn to avoid garbage. 
    324326                self.status[:3] == "413" 
    325327                # No Content-Length. Close conn to determine transfer-length. 
    326                 or "content-length" not in hkeys)): 
     328                or ("content-length" not in hkeys and \ 
     329                    self.status[:3] not in NO_BODY_CODES))): 
    327330            if "connection" not in hkeys: 
    328331                self.outheaders.append(("Connection", "close")) 
    329332            self.close_connection = True 

Hosted by WebFaction

Log in as guest/cpguest to create tickets