Commit 8469b013 authored by Aaron Crickenberger's avatar Aaron Crickenberger

TestLoopbackHostPort should accept IPv6 loopback host

parent 33fc75e2
......@@ -17,7 +17,7 @@ limitations under the License.
package server
import (
"strings"
"net"
"testing"
)
......@@ -37,8 +37,8 @@ func TestLoopbackHostPort(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if !strings.HasPrefix(host, "127.") {
t.Fatalf("expected host to start with 127., got %q", host)
if ip := net.ParseIP(host); ip == nil || !ip.IsLoopback() {
t.Fatalf("expected host to be loopback, got %q", host)
}
if port != "443" {
t.Fatalf("expected 443 as port, got %q", port)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment