From 5b1b2019c33d0f0472081b64025eba034f3004fd Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 30 Mar 2025 12:01:02 +0200 Subject: lib/cgi.hpp: better 'Server' field, no spaces anymore (according to std) Signed-off-by: Amlal El Mahrouss --- examples/cgi/cgi.cc | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/cgi/cgi.cc b/examples/cgi/cgi.cc index c2b4267..7897122 100644 --- a/examples/cgi/cgi.cc +++ b/examples/cgi/cgi.cc @@ -10,7 +10,66 @@ #include #include +const std::string g_file_list = R"( + + + + + Uh Oh! + + + +

Uh Oh!

+
No HTML file were found on this directory, please seek help from your systems administrator.
+
+ + + + + + + + + +
Name

Refresh

+
stdx's Common Gateway Server.
+ + +)"; + /* finally test it */ +/* @brief this stub loads a 'index.html' or returns an error message if not found. */ int main(int argc, char** argv) { // ... let's assume we serve data. @@ -23,7 +82,7 @@ int main(int argc, char** argv) if (fp.good()) ss_file << fp.rdbuf(); else - ss_file << "\n"; + ss_file << g_file_list; fp.close(); -- cgit v1.2.3