mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 13:11:33 +00:00
headers must be sent before close()
This commit is contained in:
@@ -280,6 +280,11 @@ clear:
|
||||
Py_DECREF((PyObject *)wsgi_req->async_sendfile);
|
||||
}
|
||||
|
||||
// send the headers if not already sent
|
||||
if (!wsgi_req->headers_sent && wsgi_req->headers_hvec > 0) {
|
||||
uwsgi_python_do_send_headers(wsgi_req);
|
||||
}
|
||||
|
||||
if (wsgi_req->async_placeholder) {
|
||||
// CALL close() ALWAYS if we are working with an iterator !!!
|
||||
if (PyObject_HasAttrString((PyObject *)wsgi_req->async_result, "close")) {
|
||||
@@ -299,12 +304,6 @@ clear:
|
||||
Py_DECREF((PyObject *)wsgi_req->async_placeholder);
|
||||
}
|
||||
|
||||
// send the headers if not already sent
|
||||
if (!wsgi_req->headers_sent && wsgi_req->headers_hvec > 0) {
|
||||
uwsgi_python_do_send_headers(wsgi_req);
|
||||
}
|
||||
|
||||
|
||||
Py_DECREF((PyObject *)wsgi_req->async_result);
|
||||
PyErr_Clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user