diff options
Diffstat (limited to 'libgo/go/net/url/url_test.go')
-rw-r--r-- | libgo/go/net/url/url_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libgo/go/net/url/url_test.go b/libgo/go/net/url/url_test.go index d8b253142f0..75e8abe4eb3 100644 --- a/libgo/go/net/url/url_test.go +++ b/libgo/go/net/url/url_test.go @@ -188,6 +188,37 @@ var urltests = []URLTest{ }, "http://user:password@google.com", }, + // unescaped @ in username should not confuse host + { + "http://j@ne:password@google.com", + &URL{ + Scheme: "http", + User: UserPassword("j@ne", "password"), + Host: "google.com", + }, + "http://j%40ne:password@google.com", + }, + // unescaped @ in password should not confuse host + { + "http://jane:p@ssword@google.com", + &URL{ + Scheme: "http", + User: UserPassword("jane", "p@ssword"), + Host: "google.com", + }, + "http://jane:p%40ssword@google.com", + }, + { + "http://j@ne:password@google.com/p@th?q=@go", + &URL{ + Scheme: "http", + User: UserPassword("j@ne", "password"), + Host: "google.com", + Path: "/p@th", + RawQuery: "q=@go", + }, + "http://j%40ne:password@google.com/p@th?q=@go", + }, { "http://www.google.com/?q=go+language#foo", &URL{ |