aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/http_base.h
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2017-02-05 17:48:03 -0500
committerLee Clagett <code@leeclagett.com>2017-02-06 01:15:41 -0500
commitce7fcbb4aea884bb4bf433cf419ffa267f859c87 (patch)
treee8fb644b62006d78f801d739fbebad50f2c2409d /contrib/epee/include/net/http_base.h
parentMerge pull request #1669 (diff)
downloadmonero-ce7fcbb4aea884bb4bf433cf419ffa267f859c87.tar.xz
Add server auth to monerod, and client auth to wallet-cli and wallet-rpc
Diffstat (limited to 'contrib/epee/include/net/http_base.h')
-rw-r--r--contrib/epee/include/net/http_base.h12
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