diff -r 9b48a1427aef -r ca0cf1016a8b src/server/daemon/error.c --- a/src/server/daemon/error.c Tue Dec 27 19:36:19 2016 +0100 +++ b/src/server/daemon/error.c Tue Dec 27 19:50:20 2016 +0100 @@ -45,19 +45,25 @@ int nsapi_error_request(Session *sn, Request *rq) { short status = rq->status_num; - sstr_t msg = error_std; - switch(status) { - case 403: { - msg = error_403; - break; - } - case 404: { - msg = error_404; - break; - } - case 500: { - msg = error_500; - break; + sstr_t msg; + if(status < 400) { + msg.ptr = NULL; + msg.length = 0; + } else { + switch(status) { + default: msg = error_std; + case 403: { + msg = error_403; + break; + } + case 404: { + msg = error_404; + break; + } + case 500: { + msg = error_500; + break; + } } } @@ -68,7 +74,9 @@ pblock_nvinsert("content-type", "text/html", rq->srvhdrs); http_start_response(sn, rq); - net_write(sn->csd, msg.ptr, msg.length); + if(msg.length > 0) { + net_write(sn->csd, msg.ptr, msg.length); + } return REQ_PROCEED; }