Skip to content

Commit 6bfcc62

Browse files
Don't try to access redirect config for forwarded requests (#6678)
Co-authored-by: Amaury Chamayou <[email protected]>
1 parent 50cc31b commit 6bfcc62

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/node/rpc/frontend.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,16 @@ namespace ccf
666666
return;
667667
}
668668

669-
const auto listen_interface =
670-
ctx->get_session_context()->interface_id.value_or(
671-
PRIMARY_RPC_INTERFACE);
672-
const auto redirections = get_redirections_config(listen_interface);
669+
std::optional<ccf::NodeInfoNetwork_v2::NetInterface::Redirections>
670+
redirections = std::nullopt;
671+
672+
// If there's no interface ID, this is already forwarded or otherwise
673+
// special - don't try to redirect it
674+
if (ctx->get_session_context()->interface_id.has_value())
675+
{
676+
redirections = get_redirections_config(
677+
ctx->get_session_context()->interface_id.value());
678+
}
673679

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

0 commit comments

Comments
 (0)