Changeset 1521
- Timestamp:
- 12/11/06 15:22:15
- Files:
-
- branches/cherrypy-2.x/cherrypy/_cphttptools.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cherrypy-2.x/cherrypy/_cphttptools.py
r1516 r1521 413 413 except KeyError: 414 414 pass 415 elif code < 200 or code in (204, 304): 416 # "All 1xx (informational), 204 (no content), 417 # and 304 (not modified) responses MUST NOT 418 # include a message-body." 419 self.headers.pop('Content-Length', None) 420 self.body = "" 415 421 else: 416 422 # Responses which are not streamed should have a Content-Length, 417 423 # but allow user code to set Content-Length if desired. 418 if (self.headers.get('Content-Length') is None 419 and code not in (304,)): 424 if self.headers.get('Content-Length') is None: 420 425 content = self.collapse_body() 421 426 self.headers['Content-Length'] = len(content)

