diff options
author | David Symonds <dsymonds@golang.org> | 2009-06-11 15:55:03 -0700 |
---|---|---|
committer | David Symonds <dsymonds@golang.org> | 2009-06-11 15:55:03 -0700 |
commit | 7007a6b5810824630fdc118fba739d56c5ba9e04 (patch) | |
tree | c508648a859f8e968ce71c9a1a5bca0b08bb5384 /src/pkg/http/client_test.go | |
parent | 67fe3450942aa494a508ac17b9391f67edb59037 (diff) | |
download | golang-7007a6b5810824630fdc118fba739d56c5ba9e04.tar.gz |
Switch http client_test to use google.com/robots.txt to avoid redirect loop.
www.google.com seems to be redirecting requests in an infinite loop. I haven't tracked down whether it's their code or this code that is causing it. This is just a quick fix so that this test passes.
APPROVED=r
DELTA=4 (0 added, 0 deleted, 4 changed)
OCL=30178
CL=30210
Diffstat (limited to 'src/pkg/http/client_test.go')
-rw-r--r-- | src/pkg/http/client_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/http/client_test.go b/src/pkg/http/client_test.go index e9354fc40..6cde4a41c 100644 --- a/src/pkg/http/client_test.go +++ b/src/pkg/http/client_test.go @@ -16,9 +16,9 @@ import ( func TestClient(t *testing.T) { // TODO: add a proper test suite. Current test merely verifies that - // we can retrieve the Google home page. - - r, url, err := Get("http://www.google.com"); + // we can retrieve the Google robots.txt file. + + r, url, err := Get("http://www.google.com/robots.txt"); var b []byte; if err == nil { b, err = io.ReadAll(r.Body); @@ -33,8 +33,8 @@ func TestClient(t *testing.T) { t.Errorf("Error fetching URL: %v", err); } else { s := string(b); - if (!strings.HasPrefix(s, "<html>")) { - t.Errorf("Incorrect page body (did not begin with <html>): %q", s); + if (!strings.HasPrefix(s, "User-agent:")) { + t.Errorf("Incorrect page body (did not begin with User-agent): %q", s); } } } |