From 5fd1edc9072573d26689fca4b8e54df705aa2b35 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sat, 27 Oct 2018 01:31:34 +0200 Subject: [PATCH] Write some formatted content on unhandled --- misc/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/main.cpp b/misc/main.cpp index 0c734f0..54ce5e5 100644 --- a/misc/main.cpp +++ b/misc/main.cpp @@ -36,7 +36,9 @@ int main(int argc, char **argv) { }).unhandled([](auto *res, auto *req) { - res->end("Here's nothing for you to see!"); + res->writeStatus("404 Not Found"); + res->writeHeader("Content-Type", "text/html; charset=utf-8"); + res->end("

404 Not Found

µWebSockets v0.15"); }).listen(3000, [](auto *token) { if (token) {