Sets the "wsgi.input_terminated" environment flag, thus enabling Werkzeug to pass chunked requests as streams. The gunicorn server should set this, but it's not yet been implemented.
()
| 70 | |
| 71 | @app.before_request |
| 72 | def handle_chunking(): |
| 73 | """ |
| 74 | Sets the "wsgi.input_terminated" environment flag, thus enabling |
| 75 | Werkzeug to pass chunked requests as streams. The gunicorn server |
| 76 | should set this, but it's not yet been implemented. |
| 77 | """ |
| 78 | |
| 79 | transfer_encoding = request.headers.get("Transfer-Encoding", None) |
| 80 | if transfer_encoding == u"chunked": |
| 81 | request.environ["wsgi.input_terminated"] = True |
| 82 | |
| 83 | |
| 84 | @app.after_request |