Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1266)

Unified Diff: grpc/cmd/rpc/main.go

Issue 2227113002: Update bulidbucket client (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/tools/dmtool/vizQuery.go ('k') | logdog/client/butler/output/logdog/output.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grpc/cmd/rpc/main.go
diff --git a/grpc/cmd/rpc/main.go b/grpc/cmd/rpc/main.go
index 22b7af15ae5b9bd5be3aec1be49a3ffc0ae33166..c05db653624ef30c23608c7c20bea699eb1fc6d2 100644
--- a/grpc/cmd/rpc/main.go
+++ b/grpc/cmd/rpc/main.go
@@ -7,7 +7,6 @@ package main
import (
"fmt"
"os"
- "strings"
"github.com/maruel/subcommands"
"golang.org/x/net/context"
@@ -15,6 +14,7 @@ import (
"github.com/luci/luci-go/client/authcli"
"github.com/luci/luci-go/common/auth"
"github.com/luci/luci-go/common/cli"
+ "github.com/luci/luci-go/common/lhttp"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/logging/gologger"
"github.com/luci/luci-go/grpc/prpc"
@@ -82,7 +82,7 @@ func (r *cmdRun) authenticatedClient(ctx context.Context, host string) (*prpc.Cl
Host: host,
Options: prpc.DefaultOptions(),
}
- client.Options.Insecure = isLocalHost(host)
+ client.Options.Insecure = lhttp.IsLocalHost(host)
return &client, nil
}
@@ -110,19 +110,6 @@ func (r *cmdRun) done(err error) int {
return 0
}
-func isLocalHost(host string) bool {
- switch {
- case host == "localhost", strings.HasPrefix(host, "localhost:"):
- case host == "127.0.0.1", strings.HasPrefix(host, "127.0.0.1:"):
- case host == "[::1]", strings.HasPrefix(host, "[::1]:"):
- case strings.HasPrefix(host, ":"):
-
- default:
- return false
- }
- return true
-}
-
var application = &cli.Application{
Name: "rpc",
Title: "Remote Procedure Call CLI",
« no previous file with comments | « dm/tools/dmtool/vizQuery.go ('k') | logdog/client/butler/output/logdog/output.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698