Changeset 1988
- Timestamp:
- 06/23/08 23:04:12
- Files:
-
- trunk/cherrypy/test/test_conn.py (modified) (1 diff)
- trunk/cherrypy/wsgiserver/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/test_conn.py
r1971 r1988 547 547 conn.close() 548 548 549 def test_Content_Length(self): 550 # Try a non-chunked request where Content-Length exceeds 551 # server.max_request_body_size. Assert error before body send. 552 self.persistent = True 553 conn = self.HTTP_CONN 554 conn.putrequest("POST", "/upload", skip_host=True) 555 conn.putheader("Host", self.HOST) 556 conn.putheader("Content-Type", "text/plain") 557 conn.putheader("Content-Length", 9999) 558 conn.endheaders() 559 response = conn.getresponse() 560 self.status, self.headers, self.body = webtest.shb(response) 561 self.assertStatus(413) 562 self.assertBody("") 563 conn.close() 564 549 565 def test_HTTP10(self): 550 566 self.PROTOCOL = "HTTP/1.0" trunk/cherrypy/wsgiserver/__init__.py
r1978 r1988 396 396 except ValueError, ex: 397 397 self.simple_response("400 Bad Request", repr(ex.args)) 398 return 399 400 mrbs = self.max_request_body_size 401 if mrbs and int(environ.get("CONTENT_LENGTH", 0)) > mrbs: 402 self.simple_response("413 Request Entity Too Large") 398 403 return 399 404

