mirror of
https://github.com/monero-project/monero.git
synced 2025-05-05 02:05:09 -04:00
RPC Add cross origin resource sharing support
This commit is contained in:
parent
8d511f3c24
commit
69c37200aa
10 changed files with 82 additions and 19 deletions
5
contrib/epee/include/net/http_server_impl_base.h
Normal file → Executable file
5
contrib/epee/include/net/http_server_impl_base.h
Normal file → Executable file
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue