mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-08 22:08:00 +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;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user