void canonicalizer_helper::append_x_ms_headers() { const web::http::http_headers& headers = m_request.headers(); for (web::http::http_headers::const_iterator it = headers.begin(); it != headers.end(); ++it) { const utility::string_t& key = it->first; if ((key.size() > ms_header_prefix.size()) && std::equal(ms_header_prefix.cbegin(), ms_header_prefix.cend(), key.cbegin())) { if (!it->second.empty()) { utility::string_t transformed_key(key); std::transform(transformed_key.begin(), transformed_key.end(), transformed_key.begin(), core::utility_char_tolower); m_result << transformed_key << U(":"); append(it->second); } } } }
void canonicalizer_helper::append_x_ms_headers() { const web::http::http_headers& headers = m_request.headers(); for (web::http::http_headers::const_iterator it = headers.begin(); it != headers.end(); ++it) { const utility::char_t *key = it->first.c_str(); size_t key_size = it->first.size(); // disables warning 4996 to bypass the usage of std::equal; // a more secure usage of std::equal with 5 parameters is supported by c++14. // to be compatible with c++11, warning 4996 is disabled. if ((key_size > ms_header_prefix_size) && std::equal(ms_header_prefix, ms_header_prefix + ms_header_prefix_size, key, [](const utility::char_t &c1, const utility::char_t &c2) {return c1 == c2;})) { utility::string_t transformed_key(key); std::transform(transformed_key.begin(), transformed_key.end(), transformed_key.begin(), core::utility_char_tolower); m_result.append(transformed_key); m_result.append(_XPLATSTR(":")); append(it->second); } } }