diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-04-18 17:28:01 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-04-18 17:28:01 +0200 |
commit | 97ced11f63f43310180c4b507ed95e5360e4723b (patch) | |
tree | be00310c47772f8997f917da0f2057dc7f21ef9a | |
parent | d60210d4862f792c1e04ee143bad59bb162fb789 (diff) |
Bugfixes: Close std_in after writing. Enable all HTTP methods
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | plugins/cgi/cgi.cpp | 6 |
2 files changed, 1 insertions, 6 deletions
@@ -1,5 +1,4 @@ -./plugins/webbox/webbox.cpp:43: warning: the use of `tmpnam' is dangerous, better use `mkstemp' Request properties: Remote Address, e.g. [::1]:8081 -> ipv6 / ipv4 Speed up config.GetPath read: The socket was closed due to a timeout 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("?")}; |