From 9c9fbdc0de480f05e62d75a1f6e43e801c2ae7f0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 1 Sep 2016 00:06:12 +0100 Subject: Get HTTP method from env --- icespider/fcgi/Jamfile.jam | 3 +++ icespider/fcgi/cgiRequestBase.cpp | 5 ++++- icespider/unittests/Jamfile.jam | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/icespider/fcgi/Jamfile.jam b/icespider/fcgi/Jamfile.jam index c607ed1..cf0e7af 100644 --- a/icespider/fcgi/Jamfile.jam +++ b/icespider/fcgi/Jamfile.jam @@ -3,7 +3,10 @@ lib fcgi++ : : fcgi++ ; lib icespider-fcgi : [ glob-tree *.cpp : bin ] + ../common/http.ice : + pure + yes fcgi fcgi++ ..//core diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp index 922ba9a..85f7966 100644 --- a/icespider/fcgi/cgiRequestBase.cpp +++ b/icespider/fcgi/cgiRequestBase.cpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace ba = boost::algorithm; @@ -75,7 +76,9 @@ namespace IceSpider { HttpMethod CgiRequestBase::getRequestMethod() const { - return HttpMethod::GET; + auto i = envmap.find("REQUEST_METHOD"); + return Slicer::ModelPartForEnum::lookup( + std::string(std::get<0>(i->second), std::get<1>(i->second))); } OptionalString diff --git a/icespider/unittests/Jamfile.jam b/icespider/unittests/Jamfile.jam index 3ce12f0..779aed7 100644 --- a/icespider/unittests/Jamfile.jam +++ b/icespider/unittests/Jamfile.jam @@ -81,12 +81,16 @@ run run testFcgi.cpp ../fcgi/cgiRequestBase.cpp + ../common/http.ice : : : BOOST_TEST_DYN_LINK + pure + yes testCommon ../common//icespider-common ../core//icespider-core boost_system + slicer ../fcgi : testFcgi ; -- cgit v1.2.3