author | Michael Krelin <hacker@klever.net> | 2005-05-09 11:00:28 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-05-09 11:00:28 (UTC) |
commit | 43d47575878e4eaf3c8da84bf609fcd0bde595fb (patch) (side-by-side diff) | |
tree | f7ec4d1f0d0a01b43feb5c9b4f414e870036522c /src/cgi_gateway.cc | |
parent | d9578a5ae0ac4e44ff5e3c13d3f39f400f51bcf2 (diff) | |
download | kingate-43d47575878e4eaf3c8da84bf609fcd0bde595fb.zip kingate-43d47575878e4eaf3c8da84bf609fcd0bde595fb.tar.gz kingate-43d47575878e4eaf3c8da84bf609fcd0bde595fb.tar.bz2 |
1. http headers container added
2. preliminary cookies support
3. absolutely useless http_quoted_string and http_quote utility functions added
-rw-r--r-- | src/cgi_gateway.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cgi_gateway.cc b/src/cgi_gateway.cc index 30410f2..ab48f78 100644 --- a/src/cgi_gateway.cc +++ b/src/cgi_gateway.cc @@ -14,32 +14,36 @@ namespace kingate { try { string qs = get_meta("QUERY_STRING"); parse_query(qs,get); }catch(exception_notfound& enf) { } // Fetch POST content if(!strcasecmp(content_type().c_str(),"application/x-www-form-urlencoded")) { unsigned long cl = content_length(); if(cl) { char * tmp = new char[cl]; iface.in().read(tmp,cl); string qs(tmp,cl); delete tmp; parse_query(qs,post); } b_parsed_content = true; } + // Parse cookies + try { + cookies.parse_cookies(get_meta("HTTP_COOKIE")); + }catch(exception_notfound& enf) { } } bool cgi_gateway::has_GET(const string& n) const { return get.find(n) != get.end(); } const string& cgi_gateway::get_GET(const string& n) const { params_t::const_iterator i = get.find(n); if(i==get.end()) throw exception_notfound(CODEPOINT,"no such parameter"); return i->second; } bool cgi_gateway::has_POST(const string& n) const { return post.find(n) != post.end(); } const string& cgi_gateway::get_POST(const string& n) const { params_t::const_iterator i = post.find(n); |