mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
* HTTP.{cpp,h} : add add_header() variant with std::string
This commit is contained in:
parent
f245feb0b0
commit
a76d8f0f9f
4
HTTP.cpp
4
HTTP.cpp
|
@ -193,6 +193,10 @@ namespace http {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HTTPMsg::add_header(const char *name, std::string & value, bool replace) {
|
||||||
|
add_header(name, value.c_str(), replace);
|
||||||
|
}
|
||||||
|
|
||||||
void HTTPMsg::add_header(const char *name, const char *value, bool replace) {
|
void HTTPMsg::add_header(const char *name, const char *value, bool replace) {
|
||||||
std::size_t count = headers.count(name);
|
std::size_t count = headers.count(name);
|
||||||
if (count && !replace)
|
if (count && !replace)
|
||||||
|
|
1
HTTP.h
1
HTTP.h
|
@ -57,6 +57,7 @@ namespace http {
|
||||||
struct HTTPMsg {
|
struct HTTPMsg {
|
||||||
std::map<std::string, std::string> headers;
|
std::map<std::string, std::string> headers;
|
||||||
|
|
||||||
|
void add_header(const char *name, std::string & value, bool replace = false);
|
||||||
void add_header(const char *name, const char *value, bool replace = false);
|
void add_header(const char *name, const char *value, bool replace = false);
|
||||||
void del_header(const char *name);
|
void del_header(const char *name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue