pass const strings for HTTP headers

This commit is contained in:
orignal 2024-09-02 21:05:40 -04:00
parent 06e3a1b57a
commit 0046a8b3ec
3 changed files with 15 additions and 12 deletions

View file

@ -269,7 +269,7 @@ namespace http
return host.rfind(".i2p") == ( host.size() - 4 );
}
void HTTPMsg::add_header(const char *name, std::string & value, bool replace) {
void HTTPMsg::add_header(const char *name, const std::string & value, bool replace) {
add_header(name, value.c_str(), replace);
}

View file

@ -70,7 +70,7 @@ namespace http
{
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 std::string & value, bool replace = false);
void add_header(const char *name, const char *value, bool replace = false);
void del_header(const char *name);