aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/http_server_impl_base.h
diff options
context:
space:
mode:
authorTim L <timo614@gmail.com>2017-10-24 09:26:05 -0400
committerTim L <timo614@gmail.com>2017-10-30 13:55:56 -0400
commit69c37200aa87f100f731e755bdca7a0dc6ae820a (patch)
tree3ce8802ae8709ba3e49a16c5a1d5f07038fb819f /contrib/epee/include/net/http_server_impl_base.h
parentMerge pull request #2601 (diff)
downloadmonero-69c37200aa87f100f731e755bdca7a0dc6ae820a.tar.xz
RPC Add cross origin resource sharing support
Diffstat (limited to 'contrib/epee/include/net/http_server_impl_base.h')
-rwxr-xr-x[-rw-r--r--]contrib/epee/include/net/http_server_impl_base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/epee/include/net/http_server_impl_base.h b/contrib/epee/include/net/http_server_impl_base.h
index acecbb2d4..0788c6a4b 100644..100755
--- a/contrib/epee/include/net/http_server_impl_base.h
+++ b/contrib/epee/include/net/http_server_impl_base.h
@@ -56,6 +56,7 @@ namespace epee
{}
bool init(const std::string& bind_port = "0", const std::string& bind_ip = "0.0.0.0",
+ std::vector<std::string> access_control_origins = std::vector<std::string>(),
boost::optional<net_utils::http::login> user = boost::none)
{
@@ -65,6 +66,10 @@ namespace epee
//here set folder for hosting reqests
m_net_server.get_config_object().m_folder = "";
+ //set access control allow origins if configured
+ std::sort(access_control_origins.begin(), access_control_origins.end());
+ m_net_server.get_config_object().m_access_control_origins = std::move(access_control_origins);
+
m_net_server.get_config_object().m_user = std::move(user);
MGINFO("Binding on " << bind_ip << ":" << bind_port);