diff --git a/mc_test.go b/mc_test.go index 65dd4abb..2cebbfe0 100644 --- a/mc_test.go +++ b/mc_test.go @@ -164,15 +164,6 @@ func (s *TestSuite) TestNewConfigV6(c *C) { } } -func (s *TestSuite) TestRecursiveURL(c *C) { - c.Assert(isURLRecursive("url..."), Equals, true) - c.Assert(isURLRecursive("url.."), Equals, false) - c.Assert(stripRecursiveURL("url..."), Equals, "url") - c.Assert(stripRecursiveURL("url.."), Equals, "url..") - c.Assert(stripRecursiveURL("..."), Equals, ".") - c.Assert(stripRecursiveURL("...url"), Equals, "...url") -} - func (s *TestSuite) TestHostConfig(c *C) { hostcfg, err := getHostConfig("https://s3.amazonaws.com") c.Assert(err, IsNil) diff --git a/mirror-url.go b/mirror-url.go index 43990a62..a515ea56 100644 --- a/mirror-url.go +++ b/mirror-url.go @@ -52,14 +52,6 @@ func checkMirrorSyntax(ctx *cli.Context) { cli.ShowCommandHelpAndExit(ctx, "mirror", 1) // last argument is exit code. } - // Check if any of the arg is recursive type. - for _, arg := range ctx.Args() { - // Recursive URLs are not allowed in target. - if isURLRecursive(arg) { - fatalIf(errDummy().Trace(), fmt.Sprintf("Recursive option is not supported for target ‘%s’ argument.", arg)) - } - } - // extract URLs. URLs, err := args2URLs(ctx.Args()) fatalIf(err.Trace(ctx.Args()...), "Unable to parse arguments.") @@ -68,11 +60,9 @@ func checkMirrorSyntax(ctx *cli.Context) { tgtURLs := URLs[1:] /****** Generic rules *******/ - // Recursive source URL. - newSrcURL := stripRecursiveURL(srcURL) - _, srcContent, err := url2Stat(newSrcURL) - if err != nil && !prefixExists(newSrcURL) { - fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+newSrcURL+"’.") + _, srcContent, err := url2Stat(srcURL) + if err != nil && !prefixExists(srcURL) { + fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.") } if err == nil && !srcContent.Type.IsDir() { diff --git a/url_test.go b/url_test.go index 75d757e6..4ae538b8 100644 --- a/url_test.go +++ b/url_test.go @@ -38,16 +38,6 @@ func (s *TestSuite) TestURLJoinPath(c *C) { c.Assert(url, Equals, "http://s3.mycompany.io/dev/mybucket/bin/") } -func (s *TestSuite) TestStripRecursiveURL(c *C) { - // Strip ‘...’ excluding trailing ‘/’ - url := stripRecursiveURL("http://s3.mycompany.io/dev/...") - c.Assert(url, Equals, "http://s3.mycompany.io/dev/") - - // Strip ‘...‘ - url = stripRecursiveURL("http://s3.mycompany.io/test...") - c.Assert(url, Equals, "http://s3.mycompany.io/test") -} - func (s *TestSuite) TestURL2DirContent(c *C) { _, err := url2DirContent(".") c.Assert(err, IsNil)