Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(700)

Unified Diff: src/net/url/url_test.go

Issue 185250043: code review 185250043: net/url: Handling invalid slashes after url scheme.
Patch Set: diff -r 586738173884643d0dca3fd844f73294984d0b9c https://code.google.com/p/go/ Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/net/url/url.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/net/url/url_test.go
===================================================================
--- a/src/net/url/url_test.go
+++ b/src/net/url/url_test.go
@@ -112,6 +112,39 @@
},
"http:www.google.com/?q=go+language",
},
+ // path with extra leading ///, expected formatting
+ {
+ "http:///www.google.com/?q=go+language",
+ &URL{
+ Scheme: "http",
+ Path: "/",
+ Opaque: "",
+ Host: "www.google.com",
+ RawQuery: "q=go+language",
+ },
+ "http://www.google.com/?q=go+language",
+ },
+
+ // ssh checks
+ {
+ "ssh://///gobot:foo@github.com/go.git",
+ &URL{
+ Scheme: "ssh",
+ User: UserPassword("gobot", "foo"),
+ Host: "github.com",
+ Path: "/go.git",
+ },
+ "ssh://gobot:foo@github.com/go.git",
+ },
+ {
+ "http:/localhost:9999/a",
+ &URL{
+ Scheme: "http",
+ Host: "localhost:9999",
+ Path: "/a",
+ },
+ "http://localhost:9999/a",
+ },
// path without leading /, so no parsing
{
"http:%2f%2fwww.google.com/?q=go+language",
@@ -127,9 +160,9 @@
"mailto:/webmaster@golang.org",
&URL{
Scheme: "mailto",
- Path: "/webmaster@golang.org",
+ Opaque: "webmaster@golang.org",
},
- "mailto:///webmaster@golang.org", // unfortunate compromise
+ "mailto:webmaster@golang.org",
},
// non-authority
{
« no previous file with comments | « src/net/url/url.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b