diff options
Diffstat (limited to 'libgo/go/net/http/client_test.go')
-rw-r--r-- | libgo/go/net/http/client_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libgo/go/net/http/client_test.go b/libgo/go/net/http/client_test.go index c74611011a8..aa0bf4be676 100644 --- a/libgo/go/net/http/client_test.go +++ b/libgo/go/net/http/client_test.go @@ -428,3 +428,15 @@ func TestClientInsecureTransport(t *testing.T) { } } } + +func TestClientErrorWithRequestURI(t *testing.T) { + req, _ := NewRequest("GET", "http://localhost:1234/", nil) + req.RequestURI = "/this/field/is/illegal/and/should/error/" + _, err := DefaultClient.Do(req) + if err == nil { + t.Fatalf("expected an error") + } + if !strings.Contains(err.Error(), "RequestURI") { + t.Errorf("wanted error mentioning RequestURI; got error: %v", err) + } +} |