|
|
|
@ -107,8 +107,9 @@ func TestURLUnmarshalJSON(t *testing.T) { |
|
|
|
|
{[]byte(`"https://play.min.io:0"`), &URL{Scheme: "https", Host: "play.min.io:0"}, false}, |
|
|
|
|
{[]byte(`"https://147.75.201.93:9000/"`), &URL{Scheme: "https", Host: "147.75.201.93:9000", Path: "/"}, false}, |
|
|
|
|
{[]byte(`"https://s3.amazonaws.com/?location"`), &URL{Scheme: "https", Host: "s3.amazonaws.com", Path: "/", RawQuery: "location"}, false}, |
|
|
|
|
{[]byte(`"http://myminio:10000/mybucket//myobject/"`), &URL{Scheme: "http", Host: "myminio:10000", Path: "/mybucket/myobject"}, false}, |
|
|
|
|
{[]byte(`"http://myminio:10000/mybucket/myobject//"`), &URL{Scheme: "http", Host: "myminio:10000", Path: "/mybucket/myobject/"}, false}, |
|
|
|
|
{[]byte(`"ftp://myftp.server:10000/myuser"`), &URL{Scheme: "ftp", Host: "myftp.server:10000", Path: "/myuser"}, false}, |
|
|
|
|
{[]byte(`"http://webhook.server:10000/mywebhook/"`), &URL{Scheme: "http", Host: "webhook.server:10000", Path: "/mywebhook/"}, false}, |
|
|
|
|
{[]byte(`"myserver:1000"`), nil, true}, |
|
|
|
|
{[]byte(`"http://:1000/mybucket"`), nil, true}, |
|
|
|
|
{[]byte(`"https://147.75.201.93:90000/"`), nil, true}, |
|
|
|
@ -142,7 +143,7 @@ func TestParseURL(t *testing.T) { |
|
|
|
|
{"https://play.min.io:0", &URL{Scheme: "https", Host: "play.min.io:0"}, false}, |
|
|
|
|
{"https://147.75.201.93:9000/", &URL{Scheme: "https", Host: "147.75.201.93:9000", Path: "/"}, false}, |
|
|
|
|
{"https://s3.amazonaws.com/?location", &URL{Scheme: "https", Host: "s3.amazonaws.com", Path: "/", RawQuery: "location"}, false}, |
|
|
|
|
{"http://myminio:10000/mybucket//myobject/", &URL{Scheme: "http", Host: "myminio:10000", Path: "/mybucket/myobject"}, false}, |
|
|
|
|
{"http://myminio:10000/mybucket//myobject/", &URL{Scheme: "http", Host: "myminio:10000", Path: "/mybucket/myobject/"}, false}, |
|
|
|
|
{"ftp://myftp.server:10000/myuser", &URL{Scheme: "ftp", Host: "myftp.server:10000", Path: "/myuser"}, false}, |
|
|
|
|
{"myserver:1000", nil, true}, |
|
|
|
|
{"http://:1000/mybucket", nil, true}, |
|
|
|
|