diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 89a8139..ee7c673 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include <filesystem> #include <fstream> #include <iostream> +#include <sstream> #include "CGIScript.h" #include "ClientConnection.h" @@ -115,6 +116,11 @@ int main(int argc, char** argv) } } + // Check the script path to ensure that it is a valid executable + // script before attempting to start the server. + if (in_cgi_mode) + CGIScript::validate_path(cgi_program_name); + ServerConnection server(port); std::cout << "Serving a " << (in_cgi_mode ? "CGI script" : "directory") << " on port " << port << std::endl; |