Skip to content

Commit

Permalink
Don't try to access redirect config for forwarded requests (#6678)
Browse files Browse the repository at this point in the history
Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
  • Loading branch information
eddyashton and achamayou authored Dec 3, 2024
1 parent 50cc31b commit 6bfcc62
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/node/rpc/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,16 @@ namespace ccf
return;
}

const auto listen_interface =
ctx->get_session_context()->interface_id.value_or(
PRIMARY_RPC_INTERFACE);
const auto redirections = get_redirections_config(listen_interface);
std::optional<ccf::NodeInfoNetwork_v2::NetInterface::Redirections>
redirections = std::nullopt;

// If there's no interface ID, this is already forwarded or otherwise
// special - don't try to redirect it
if (ctx->get_session_context()->interface_id.has_value())
{
redirections = get_redirections_config(
ctx->get_session_context()->interface_id.value());
}

// If a redirections config was specified, then redirections are used
// and no forwarding is done
Expand Down

0 comments on commit 6bfcc62

Please sign in to comment.