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

Unified Diff: dm/tools/dmtool/vizQuery.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/appengine/distributor/jobsim/run.go ('k') | grpc/cmd/rpc/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/tools/dmtool/vizQuery.go
diff --git a/dm/tools/dmtool/vizQuery.go b/dm/tools/dmtool/vizQuery.go
index e6da08a8dfe54a6dae8353df4c1de9d9fe9221fa..0eec5b949d7624a11ae8f7e6d82c242d187689b2 100644
--- a/dm/tools/dmtool/vizQuery.go
+++ b/dm/tools/dmtool/vizQuery.go
@@ -22,6 +22,7 @@ import (
"github.com/luci/luci-go/common/cli"
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/errors"
+ "github.com/luci/luci-go/common/lhttp"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/system/ctxcmd"
dm "github.com/luci/luci-go/dm/api/service/v1"
@@ -195,19 +196,6 @@ func runQuery(c context.Context, dc dm.DepsClient, query *dm.WalkGraphReq) (ret
return
}
-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
-}
-
func (r *visQueryRun) Run(a subcommands.Application, args []string) int {
r.cmd = cmdVisQuery
@@ -238,7 +226,7 @@ func (r *visQueryRun) Run(a subcommands.Application, args []string) int {
Host: r.host,
Options: prpc.DefaultOptions(),
}
- client.Options.Insecure = isLocalHost(r.host)
+ client.Options.Insecure = lhttp.IsLocalHost(r.host)
dc := dm.NewDepsPRPCClient(client)
prev := ""
« no previous file with comments | « dm/appengine/distributor/jobsim/run.go ('k') | grpc/cmd/rpc/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698