Beispiel #1
0
vector<ck_string> client_response::get_all_matching_headers(const ck_string& header) const
{
    vector<ck_string> matchingHeaders;

    auto matches = _headerParts.find(header.to_lower());
    if( matches != _headerParts.end() )
    {
        for( auto i = (*matches).second.begin(); i != (*matches).second.end(); ++i )
            matchingHeaders.push_back( *i );
    }

    return matchingHeaders;
}
Beispiel #2
0
void client_response::_process_request_lines(const list<ck_string>& requestLines)
{
    // Now, iterate on the header lines...

    for(list<ck_string>::const_iterator iter = requestLines.begin(), end = requestLines.end();
        iter != end;
        ++iter)
    {
        const size_t firstColon = iter->find(':');

        if(firstColon != string::npos)
        {
            const ck_string key = iter->substr(0, firstColon);
            const ck_string val = firstColon + 1 < iter->size() ? iter->substr(firstColon + 1) : "";

            _add_header(key.to_lower(), val.strip_eol());
        }
    }
}
Beispiel #3
0
ck_string client_response::get_header(const ck_string& name) const
{
    auto values = _headerParts.find( name.to_lower() );

    return (values != _headerParts.end()) ? (*values).second.front() : "";
}