src/transaction.cc
/**
 * @name    addResponseHeader
 * @brief   Adds a response header
 *
 * With this method it is possible to feed ModSecurity with a response
 * header.
 *
 * @note This method expects a NULL terminated string, for both: key and
 *       value.
 *
 * @param key     header name.
 * @param value   header value.
 *
 * @returns If the operation was successful or not.
 * @retval true Operation was successful.
 * @retval false Operation failed.
 *
 */
@name    addResponseHeader
@brief   Adds a response header

With this method it is possible to feed ModSecurity with a response
header.

@note This method expects a NULL terminated string, for both: key and
value.

@param key     header name.
@param value   header value.

@returns If the operation was successful or not.
@retval true Operation was successful.
@retval false Operation failed.
@name addResponseHeader @brief Adds a response header With this method it is possible to feed ModSecurity with a response header . @note This method expects a NULL terminated string for both : key and value . @param key header name . @param value header value . @returns If the operation was successful or not . @retval true Operation was successful . @retval false Operation failed .
int Transaction::addResponseHeader(const std::string& key,
    const std::string& value) {
    m_responseHeadersNames->assign(*m_responseHeadersNames + " " + key);
    this->m_collections.store("RESPONSE_HEADERS:" + key, value);
    if (utils::string::tolower(key) == "content-type") {
        std::vector<std::string> val = utils::string::split(value, ';');
        if (val.size() > 0) {
            this->m_responseContentType->assign(val[0]);
        }
    }
    return 1;
}
int Transaction :: addResponseHeader ( const std :: string & key , const std :: string & value ) { m_responseHeadersNames -> assign ( * m_responseHeadersNames + " " + key ) ; this -> m_collections . store ( " " + key , value ) ; if ( utils :: string :: tolower ( key ) == " " ) { std :: vector < std :: string > val = utils :: string :: split ( value , ' ' ) ; if ( val . size ( ) > 0 ) { this -> m_responseContentType -> assign ( val [ 0 ] ) ; } } return 1 ; }
@name    addResponseHeader
 @brief   Adds a response header
@name addResponseHeader @brief Adds a response header
// Removes the charset=... // Content-Type: text/html; charset=UTF-8