Browse Source

trace: Fix IPv6 local address detection.

net.SplitHostPort produces "::1", not "[::1]".

Change-Id: I5270e427ab25c2fbcae3593de47d5dd48cd92479
Reviewed-on: https://go-review.googlesource.com/10743
Reviewed-by: jcd . <jcd@golang.org>
David Symonds 10 years ago
parent
commit
dfe268fd2b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      trace/trace.go

+ 1 - 1
trace/trace.go

@@ -55,7 +55,7 @@ var AuthRequest = func(req *http.Request) (any, sensitive bool) {
 	switch {
 	case err != nil: // Badly formed address; fail closed.
 		return false, false
-	case host == "localhost" || host == "127.0.0.1" || host == "[::1]":
+	case host == "localhost" || host == "127.0.0.1" || host == "::1":
 		return true, true
 	default:
 		return false, false