| | 67 | def testBug326(self): |
|---|
| | 68 | httpcls = cherrypy.server.httpserverclass |
|---|
| | 69 | if httpcls and httpcls.__name__ == "WSGIServer": |
|---|
| | 70 | h = [("Content-type", "multipart/form-data; boundary=x"), |
|---|
| | 71 | ("Content-Length", "110")] |
|---|
| | 72 | b = """--x |
|---|
| | 73 | Content-Disposition: form-data; name="file"; filename="hello.txt" |
|---|
| | 74 | Content-Type: text/plain |
|---|
| | 75 | |
|---|
| | 76 | hello |
|---|
| | 77 | --x-- |
|---|
| | 78 | """ |
|---|
| | 79 | cherrypy.config.update({ |
|---|
| | 80 | '/bug326': {'server.maxRequestBodySize': 3, |
|---|
| | 81 | 'server.environment': 'developement', |
|---|
| | 82 | } |
|---|
| | 83 | }) |
|---|
| | 84 | ignore = helper.webtest.ignored_exceptions |
|---|
| | 85 | ignore.append(AttributeError) |
|---|
| | 86 | try: |
|---|
| | 87 | self.getPage('/bug326', h, "POST", b) |
|---|
| | 88 | self.assertStatus("413 Request Entity Too Large") |
|---|
| | 89 | finally: |
|---|
| | 90 | ignore.pop() |
|---|