-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not crash on URIs without a host component. #16184
Conversation
7979b32
to
85b5e24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A regression test in CredentialHelperProviderTest
would be nice :)
@@ -66,7 +66,12 @@ private CredentialHelperProvider( | |||
public Optional<CredentialHelper> findCredentialHelper(URI uri) { | |||
Preconditions.checkNotNull(uri); | |||
|
|||
String host = Preconditions.checkNotNull(uri.getHost()); | |||
String host = uri.getHost(); | |||
if (host == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use Guava's Strings.isNullOrEmpty()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
URIs such as `unix://...` (Unix domain socket) may legitimately be missing a host component. We should gracefully handle them when looking for a credential helper (no such helper can exist for them since the lookup is host-based, but this could change in the future). Fixes bazelbuild#16171 which is a regression in 5.3. We had some tests for this in remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df. I've filed bazelbuild#16185 to reenable them.
Done. |
@bazel-io fork 5.3.1 |
URIs such as `unix://...` (Unix domain socket) may legitimately be missing a host component. We should gracefully handle them when looking for a credential helper (no such helper can exist for them since the lookup is host-based, but this could change in the future). Fixes #16171 which is a regression in 5.3. We had some tests for this in remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df. I've filed #16185 to reenable them. Closes #16184. PiperOrigin-RevId: 470724658 Change-Id: Ibd7203546f00fe2335c14e7a5fa6d5bf64868bac Co-authored-by: Tiago Quelhas <[email protected]>
URIs such as `unix://...` (Unix domain socket) may legitimately be missing a host component. We should gracefully handle them when looking for a credential helper (no such helper can exist for them since the lookup is host-based, but this could change in the future). Fixes bazelbuild#16171 which is a regression in 5.3. We had some tests for this in remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df. I've filed bazelbuild#16185 to reenable them. Closes bazelbuild#16184. PiperOrigin-RevId: 470724658 Change-Id: Ibd7203546f00fe2335c14e7a5fa6d5bf64868bac
URIs such as
unix://...
(Unix domain socket) may legitimately be missing ahost component. We should gracefully handle them when looking for a credential
helper (no such helper can exist for them since the lookup is host-based, but
this could change in the future).
Fixes #16171 which is a regression in 5.3. We had some tests for this in
remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df.
I've filed #16185 to reenable them.