summaryrefslogtreecommitdiff
path: root/icespider/fcgi/cgiRequestBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'icespider/fcgi/cgiRequestBase.cpp')
-rw-r--r--icespider/fcgi/cgiRequestBase.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp
index f99bbf1..3b03440 100644
--- a/icespider/fcgi/cgiRequestBase.cpp
+++ b/icespider/fcgi/cgiRequestBase.cpp
@@ -6,9 +6,16 @@
#include <util.h>
#include <slicer/modelPartsTypes.h>
#include <slicer/common.h>
+#include <compileTimeFormatter.h>
namespace ba = boost::algorithm;
+namespace std {
+ ostream & operator<<(ostream & s, const IceSpider::CgiRequestBase::Env & e) {
+ return s.write(std::get<0>(e), std::get<1>(e) - std::get<0>(e));
+ }
+}
+
namespace IceSpider {
CgiRequestBase::CgiRequestBase(Core * c, char ** env) :
IHttpRequest(c)
@@ -59,6 +66,30 @@ namespace IceSpider {
}
}
+ AdHocFormatter(VarFmt, "\t%?: [%?]\n");
+ AdHocFormatter(PathFmt, "\t[%?]\n");
+ std::ostream &
+ CgiRequestBase::dump(std::ostream & s) const
+ {
+ s << "Environment dump" << std::endl;
+ for (const auto & e : envmap) {
+ VarFmt::write(s, e.first, e.second);
+ }
+ s << "Path dump" << std::endl;
+ for (const auto & e : pathElements) {
+ PathFmt::write(s, e);
+ }
+ s << "Query string dump" << std::endl;
+ for (const auto & v : qsmap) {
+ VarFmt::write(s, v.first, v.second);
+ }
+ s << "Cookie dump" << std::endl;
+ for (const auto & c : cookiemap) {
+ VarFmt::write(s, c.first, c.second);
+ }
+ return s;
+ }
+
OptionalString
CgiRequestBase::optionalLookup(const std::string & key, const VarMap & vm)
{