From 97ced11f63f43310180c4b507ed95e5360e4723b Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 18 Apr 2020 17:28:01 +0200 Subject: Bugfixes: Close std_in after writing. Enable all HTTP methods --- plugins/cgi/cgi.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'plugins/cgi/cgi.cpp') diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp index 9b06f7a..561e6ad 100644 --- a/plugins/cgi/cgi.cpp +++ b/plugins/cgi/cgi.cpp @@ -181,6 +181,7 @@ namespace { bp::child child(filename.string(), env, (bp::std_out & bp::std_err) > is_out, bp::std_in < is_in); is_in << context.GetRequestParam("body"); + is_in.close(); std::string output; std::string line; @@ -252,11 +253,6 @@ std::string cgi_plugin::generate_page( ) { try { - // Make sure we can handle the method - std::string method {GetRequestParam("method")}; - if (method != "GET" && method != "HEAD") - return HttpStatus("400", "Unknown HTTP method", SetResponseHeader); - // Request path must not contain "..". std::string rel_target{GetRequestParam("rel_target")}; size_t query_pos{rel_target.find("?")}; -- cgit v1.2.3