diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-09-01 00:06:12 +0100 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-09-01 00:22:23 +0100 | 
| commit | 9c9fbdc0de480f05e62d75a1f6e43e801c2ae7f0 (patch) | |
| tree | 3355390921cd688f9a7b33e3baa6c365f11f99e7 | |
| parent | Use Slicer enum helper for writing enumerated values (diff) | |
| download | icespider-9c9fbdc0de480f05e62d75a1f6e43e801c2ae7f0.tar.bz2 icespider-9c9fbdc0de480f05e62d75a1f6e43e801c2ae7f0.tar.xz icespider-9c9fbdc0de480f05e62d75a1f6e43e801c2ae7f0.zip | |
Get HTTP method from env
| -rw-r--r-- | icespider/fcgi/Jamfile.jam | 3 | ||||
| -rw-r--r-- | icespider/fcgi/cgiRequestBase.cpp | 5 | ||||
| -rw-r--r-- | icespider/unittests/Jamfile.jam | 4 | 
3 files changed, 11 insertions, 1 deletions
| 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++ : : <name>fcgi++ ;  lib icespider-fcgi :  	[ glob-tree *.cpp : bin ] +	../common/http.ice  	: +	<slicer>pure +	<allow-ice>yes  	<library>fcgi  	<library>fcgi++  	<library>..//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 <boost/algorithm/string/split.hpp>  #include <boost/algorithm/string/classification.hpp>  #include <util.h> +#include <slicer/modelPartsTypes.h>  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<HttpMethod>::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  	: : :  	<define>BOOST_TEST_DYN_LINK +	<slicer>pure +	<allow-ice>yes  	<library>testCommon  	<library>../common//icespider-common  	<library>../core//icespider-core  	<library>boost_system +	<library>slicer  	<include>../fcgi  	: testFcgi ; | 
