2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
2015-11-26 03:53:12 +01:00
|
|
|
#ifndef CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_
|
2012-04-03 03:34:16 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-10-14 13:32:38 +02:00
|
|
|
#include <map>
|
2012-04-03 03:34:16 +02:00
|
|
|
#include <string>
|
|
|
|
|
2019-10-14 13:32:38 +02:00
|
|
|
#include "include/cef_base.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
namespace HttpHeaderUtils {
|
|
|
|
|
2019-10-14 13:32:38 +02:00
|
|
|
typedef std::multimap<CefString, CefString> HeaderMap;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
std::string GenerateHeaders(const HeaderMap& map);
|
|
|
|
void ParseHeaders(const std::string& header_str, HeaderMap& map);
|
|
|
|
|
2019-10-14 13:32:38 +02:00
|
|
|
// Convert |str| to lower-case.
|
|
|
|
void MakeASCIILower(std::string* str);
|
|
|
|
|
|
|
|
// Finds the first instance of |name| (already lower-case) in |map| with
|
|
|
|
// case-insensitive comparison.
|
|
|
|
HeaderMap::iterator FindHeaderInMap(const std::string& name, HeaderMap& map);
|
|
|
|
|
2019-03-13 22:27:37 +01:00
|
|
|
} // namespace HttpHeaderUtils
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-11-26 03:53:12 +01:00
|
|
|
#endif // CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_
|