Copilot commented on code in PR #3511:
URL: https://github.com/apache/brpc/pull/3511#discussion_r3901904124


##########
src/brpc/nshead_pb_service_adaptor.cpp:
##########
@@ -122,6 +122,9 @@ void NsheadPbServiceAdaptor::ProcessNsheadRequest(
                                   meta->full_method_name().c_str());
             break;
         }
+        if (RejectBuiltinAccess(controller, server, sp)) {
+            break;
+        }

Review Comment:
   `RejectBuiltinAccess()` is now used in 
`NsheadPbServiceAdaptor::ProcessNsheadRequest()` to enforce `internal_port` 
gating for nshead-based pb protocols, but the new unit tests only exercise 
baidu_std/hulu/sofa paths. Adding a test that runs a server with an 
nshead-based pb protocol (e.g. `public_pbrpc`/`nshead_mcpack`/`nova_pbrpc`) and 
verifies builtin access is denied on the public port and allowed on 
`internal_port` would protect this shared adaptor path from regressions.



-- 
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]

Reply via email to