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:
parent
3fb4df637e
commit
cd72d374c5
3 changed files with 10 additions and 4 deletions
|
@ -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) <<
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue