1 // Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_ 6 #define CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_ 7 #pragma once 8 9 #include <map> 10 #include <string> 11 12 #include "include/cef_base.h" 13 14 namespace HttpHeaderUtils { 15 16 using HeaderMap = std::multimap<CefString, CefString>; 17 18 std::string GenerateHeaders(const HeaderMap& map); 19 void ParseHeaders(const std::string& header_str, HeaderMap& map); 20 21 // Convert |str| to lower-case. 22 void MakeASCIILower(std::string* str); 23 24 // Finds the first instance of |name| (already lower-case) in |map| with 25 // case-insensitive comparison. 26 HeaderMap::iterator FindHeaderInMap(const std::string& name, HeaderMap& map); 27 28 } // namespace HttpHeaderUtils 29 30 #endif // CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_ 31