(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestLocalhostAuthIPv4(t *testing.T) { |
| 99 | l, err := net.Listen("tcp", "127.0.0.1:0") |
| 100 | if err != nil { |
| 101 | t.Skip("skipping IPv4 test; can't listen on 127.0.0.1:0") |
| 102 | } |
| 103 | _, port, err := net.SplitHostPort(l.Addr().String()) |
| 104 | if err != nil { |
| 105 | t.Fatal(err) |
| 106 | } |
| 107 | |
| 108 | ts := testServer(t, l) |
| 109 | defer ts.Close() |
| 110 | |
| 111 | testLoginRequest(t, &http.Client{}, "http://127.0.0.1:"+port) |
| 112 | testLoginRequest(t, &http.Client{}, "http://localhost:"+port) |
| 113 | } |
| 114 | |
| 115 | func testLoginRequest(t *testing.T, client *http.Client, URL string) { |
| 116 | res, err := client.Get(URL) |
nothing calls this directly
no test coverage detected