mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-08-26 13:51:49 +00:00
provide a minimal 404 page
This commit is contained in:
parent
1078449b80
commit
b5e58adef2
@ -1055,7 +1055,13 @@ void ServiceConnection(AcceptedConnection *conn)
|
|||||||
conn->stream() << HTTPReply(HTTP_OK, str, false, contentType) << std::flush;
|
conn->stream() << HTTPReply(HTTP_OK, str, false, contentType) << std::flush;
|
||||||
} else {
|
} else {
|
||||||
printf("ServiceConnection: file %s not found\n", fname.c_str());
|
printf("ServiceConnection: file %s not found\n", fname.c_str());
|
||||||
conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush;
|
|
||||||
|
ostringstream s;
|
||||||
|
s << "<html><body>\r\n"
|
||||||
|
<< "<b>ERROR 404</b><br/>"
|
||||||
|
<< "ServiceConnection: file '<b>" << fname << "</b>' not found\r\n"
|
||||||
|
<< "</body></html>\r\n";
|
||||||
|
conn->stream() << HTTPReply(HTTP_NOT_FOUND, s.str(), false, "text/html; charset=utf-8") << std::flush;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user