1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-12-27 21:35:41 +00:00

query_string() should return the raw GET string.

This commit is contained in:
King_DuckZ 2017-04-05 20:07:42 +01:00
parent 3fb4df637e
commit cd72d374c5
3 changed files with 10 additions and 4 deletions

View file

@ -97,8 +97,8 @@ namespace tawashi {
return m_cgi_env[CGIVars::PATH_TRANSLATED];
}
KeyValueList CGIEnv::query_string() const {
return split_env_vars(m_cgi_env[CGIVars::QUERY_STRING]);
const std::string& CGIEnv::query_string() const {
return m_cgi_env[CGIVars::QUERY_STRING];
}
const std::string& CGIEnv::remote_addr() const {
@ -143,6 +143,10 @@ namespace tawashi {
return m_cgi_env[CGIVars::SERVER_SOFTWARE];
}
KeyValueList CGIEnv::query_string_split() const {
return split_env_vars(m_cgi_env[CGIVars::QUERY_STRING]);
}
std::ostream& CGIEnv::print_all (std::ostream& parStream, const char* parNewline) const {
for (std::size_t z = 0; z < m_cgi_env.size(); ++z) {
parStream << CGIVars::_from_integral(z) <<

View file

@ -27,7 +27,7 @@ namespace tawashi {
boost::optional<VersionInfo> gateway_interface() const a_pure;
const std::string& path_info() const;
const std::string& path_translated() const;
KeyValueList query_string() const a_pure;
const std::string& query_string() const;
const std::string& remote_addr() const;
const std::string& remote_host() const;
const std::string& remote_ident() const;
@ -39,6 +39,8 @@ namespace tawashi {
boost::optional<VersionInfo> server_protocol() const a_pure;
const std::string& server_software() const;
KeyValueList query_string_split() const a_pure;
std::ostream& print_all (std::ostream& parStream, const char* parNewline) const;
private:

View file

@ -20,7 +20,7 @@ int main() {
resp.send();
tawashi::CGIEnv cgi_env;
for (auto& pair : cgi_env.query_string()) {
for (auto& pair : cgi_env.query_string_split()) {
std::cout << "first:\t\"" << pair.first <<
"\"\tsecond:\t\"" << pair.second << "\"\n";
}