summaryrefslogtreecommitdiffhomepage
path: root/plugins/cgi/cgi.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-18 17:28:01 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-18 17:28:01 +0200
commit97ced11f63f43310180c4b507ed95e5360e4723b (patch)
treebe00310c47772f8997f917da0f2057dc7f21ef9a /plugins/cgi/cgi.cpp
parentd60210d4862f792c1e04ee143bad59bb162fb789 (diff)
Bugfixes: Close std_in after writing. Enable all HTTP methods
Diffstat (limited to 'plugins/cgi/cgi.cpp')
-rw-r--r--plugins/cgi/cgi.cpp6
1 files changed, 1 insertions, 5 deletions
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("?")};