src/server/daemon/error.c

changeset 477
39ebd50cfc12
parent 415
d938228c382e
--- a/src/server/daemon/error.c	Sat Mar 18 11:34:48 2023 +0100
+++ b/src/server/daemon/error.c	Sat Mar 18 11:44:37 2023 +0100
@@ -46,7 +46,10 @@
 int nsapi_error_request(Session *sn, Request *rq) {
     short status = rq->status_num;
     cxmutstr msg;
-    if(status < 400) {
+    if(status <= 0) {
+        status = 500;
+        msg = error_500;
+    } else if(status < 400) {
         msg.ptr = NULL;
         msg.length = 0;
     } else {
@@ -72,6 +75,7 @@
     
     pblock_kninsert(pb_key_content_length, msg.length, rq->srvhdrs);
     pblock_nvinsert("content-type", "text/html", rq->srvhdrs);
+    protocol_status(sn, rq, status, NULL);
     http_start_response(sn, rq);
     
     if(msg.length > 0) {

mercurial