mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-22 15:21:45 +00:00
fix: CORS
This commit is contained in:
1 parent
01bae46c0c
commit
992de495ad
3 files changed
+31
-3
No files matched your search
@@ -1402,16 +1402,20 @@ namespace http {
|
||||
// todo: to an another method with return;
|
||||
std::string tunnelname = params["tunnelname"];
|
||||
auto findTunnelEndpoint = [](const std::string& tunnelname) -> std::pair<uint16_t, std::string> {
|
||||
LogPrint(eLogDebug,"GetTorrentsRPC");
|
||||
for (auto& [port, server] : i2p::client::context.GetTorrentsRPCServers())
|
||||
{
|
||||
if (!server) continue;
|
||||
if (!server) {
|
||||
LogPrint(eLogError,"GetTorrentsRPCServers return nothing");
|
||||
continue;
|
||||
}
|
||||
for (const auto& [rpcPath, weakTunnel] : server->GetTunnels())
|
||||
{
|
||||
if (auto tunnel = weakTunnel.lock())
|
||||
{
|
||||
LogPrint(eLogDebug, "TUNNEL_OPENJS", tunnel->GetName());
|
||||
if (tunnel->GetName() == tunnelname)
|
||||
{
|
||||
|
||||
uint16_t rpcPort = server->GetAcceptor().local_endpoint().port();
|
||||
return std::pair<uint16_t, std::string>(rpcPort, rpcPath);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user