yyqdbngt opened a new pull request, #3780: URL: https://github.com/apache/rocketmq-dashboard/pull/3780
### Motivation The existing `UrlHostGuardTest` pins the address-classification core of the SSRF guard, but the public `check(String, boolean)` envelope guards and the loopback policy of `isAllowedHost` were untested. ### Changes - `checkShouldRejectNullOrBlankUrl`: a missing or blank URL fails fast with `URL is required`. - `checkShouldRejectNonHttpScheme`: non-http(s) schemes are rejected before any resolution. - `checkShouldRejectHostlessUrl`: URLs without a host are rejected with the dedicated message. - `checkShouldAcceptPublicUrlAndTrimTrailingSlashes`: surrounding whitespace and trailing slashes are stripped before validation, and a public IP target passes. - `isAllowedHostShouldRejectLoopbackUnlessExplicitlyAllowed`: loopback literals and `localhost` are denied unless `allowLoopback` is set. ### Verification ``` mvn -B test -Dtest=UrlHostGuardTest [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0 [INFO] BUILD SUCCESS ``` -- 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]
