diff options
Diffstat (limited to 'plugins/cgi')
-rw-r--r-- | plugins/cgi/cgi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp index 318dd1f..75e401e 100644 --- a/plugins/cgi/cgi.cpp +++ b/plugins/cgi/cgi.cpp @@ -173,7 +173,7 @@ namespace { env["HTTPS"] = c.GetRequestParam("https"); } - std::string executeFile(const fs::path& filename, CGIContext& context) + std::string executeFile(CGIContext& context) { bp::pipe is_in; bp::ipstream is_out; @@ -181,7 +181,7 @@ namespace { bp::environment env {boost::this_process::environment()}; setCGIEnvironment(env, context); - bp::child child(filename.string(), env, bp::std_out > is_out, bp::std_err > stderr, bp::std_in < is_in); + bp::child child(context.path.string(), env, bp::std_out > is_out, bp::std_err > stderr, bp::std_in < is_in); std::string body{ context.GetRequestParam("body") }; is_in.write(body.data(), body.size()); @@ -311,7 +311,7 @@ std::string cgi_plugin::generate_page( CGIContext context(GetServerParam, GetRequestParam, SetResponseHeader, path, file_path, path_info); try { - return executeFile(path, context); + return executeFile(context); } catch (const std::runtime_error& ex) { return HttpStatus("404", "Not found: "s + GetRequestParam("target"), SetResponseHeader); } catch (const std::exception& ex) { |