Commit 14ad42d6 authored by Denis Bilenko's avatar Denis Bilenko

core: when reporting 500 Internal Error, add "Connection: close" and...

core: when reporting 500 Internal Error, add "Connection: close" and "Content-type: text/plain" headers
parent 4ac15483
......@@ -475,10 +475,14 @@ cdef void _http_cb_handler(evhttp_request* request, void *arg) with gil:
cdef void report_internal_error(evhttp_request* request):
cdef evbuffer* c_buf = evbuffer_new()
evbuffer_add(c_buf, "<h1>Internal Server Error</h1>", 30)
evhttp_send_reply(request, 500, "Internal Server Error", c_buf)
evbuffer_free(c_buf)
cdef evbuffer* c_buf
if request != NULL and request.response_code == 0:
evhttp_add_header(request.output_headers, "Connection", "close")
evhttp_add_header(request.output_headers, "Content-type", "text/plain")
c_buf = evbuffer_new()
evbuffer_add(c_buf, "Internal Server Error", 21)
evhttp_send_reply(request, 500, "Internal Server Error", c_buf)
evbuffer_free(c_buf)
cdef class http:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment