Reject host-less endpoints in EndpointUtil.validateEndpoint#8489
Open
thswlsqls wants to merge 2 commits into
Open
Reject host-less endpoints in EndpointUtil.validateEndpoint#8489thswlsqls wants to merge 2 commits into
thswlsqls wants to merge 2 commits into
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8489 +/- ##
============================================
- Coverage 78.77% 78.51% -0.26%
- Complexity 8579 8602 +23
============================================
Files 1009 1013 +4
Lines 28993 29150 +157
Branches 3599 3632 +33
============================================
+ Hits 22839 22887 +48
- Misses 5311 5420 +109
Partials 843 843 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/easycla |
jack-berg
reviewed
Jun 22, 2026
Convert validateEndpoint_invalid from @valuesource to @MethodSource with named Arguments.argumentSet cases, matching the validEndpoints style in the same test class. No change to what the test asserts. Generated-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
EndpointUtil.validateEndpointaccepts host-less URIs such ashttp:localhost:4317(opaque) andhttps:/foo(single slash): they have an http/https scheme but no host, so export only fails later at connection time.uri.getHost() == nullguard after the scheme check, reusing the existing "must start with http:// or https://" message.OtlpConfigUtil.validateEndpoint(exporters/otlp/all) usesnew URL()and already rejects these; this fills the missing case inEndpointUtil's equivalent contract.Testing done
EndpointUtilTestwith valid endpoints (http, https, path, userinfo+host) and invalid ones (opaquehttp:localhost:4317, single-slashhttps:/foo, no-schemelocalhost, wrong-schemegopher://localhost)../gradlew :exporters:common:check— passed;EndpointUtilTestran 8 tests.internalpackage, signature unchanged: no apidiff; not user-facing, so no CHANGELOG.