diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-02-11 00:35:25 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-02-11 00:35:25 +0200 |
commit | eacf2124b6822d088199179b18d4587404408e0f (patch) | |
tree | 48982250b525de443794c218d5386df03e728965 /contrib/epee/include/net/http_base.h | |
parent | Merge pull request #1686 (diff) | |
parent | Add server auth to monerod, and client auth to wallet-cli and wallet-rpc (diff) | |
download | monero-eacf2124b6822d088199179b18d4587404408e0f.tar.xz |
Merge pull request #1689
ce7fcbb4 Add server auth to monerod, and client auth to wallet-cli and wallet-rpc (Lee Clagett)
Diffstat (limited to 'contrib/epee/include/net/http_base.h')
-rw-r--r-- | contrib/epee/include/net/http_base.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h index d8e31521f..e5aa06cb4 100644 --- a/contrib/epee/include/net/http_base.h +++ b/contrib/epee/include/net/http_base.h @@ -29,6 +29,9 @@ #pragma once #include <boost/lexical_cast.hpp> #include <boost/regex.hpp> +#include <boost/utility/string_ref.hpp> +#include <string> +#include <utility> #include "string_tools.h" @@ -90,6 +93,15 @@ namespace net_utils return std::string(); } + static inline void add_field(std::string& out, const boost::string_ref name, const boost::string_ref value) + { + out.append(name.data(), name.size()).append(": "); + out.append(value.data(), value.size()).append("\r\n"); + } + static inline void add_field(std::string& out, const std::pair<std::string, std::string>& field) + { + add_field(out, field.first, field.second); + } struct http_header_info |