Copilot commented on code in PR #3525:
URL: https://github.com/apache/brpc/pull/3525#discussion_r3949849236
##########
src/brpc/policy/nshead_protocol.cpp:
##########
@@ -314,6 +314,9 @@ void ProcessNsheadRequest(InputMessageBase* msg_base) {
cntl->SetFailed(ELOGOFF, "Server is stopping");
break;
}
+ if (server->RejectNonBuiltinAccessFromInternalPort(cntl)) {
+ break;
+ }
Review Comment:
RejectNonBuiltinAccessFromInternalPort() is documented to require stopping
dispatch immediately, but in nshead_protocol the code only breaks out of the
pre-check block and still calls NsheadService::ProcessNsheadRequest()
afterwards. That means a user-provided NsheadService that doesn’t check
cntl->Failed() could still execute on ServerOptions.internal_port, undermining
the intent that internal_port serves builtin/Tabbed only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]