浏览代码

Fix 'docker import' to accept urls without explicit http:// scheme

Solomon Hykes 12 年之前
父节点
当前提交
9b5f0fac81
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      commands.go

+ 2 - 0
commands.go

@@ -374,6 +374,8 @@ func (srv *Server) CmdImport(stdin io.ReadCloser, stdout io.Writer, args ...stri
 		}
 		}
 		if u.Scheme == "" {
 		if u.Scheme == "" {
 			u.Scheme = "http"
 			u.Scheme = "http"
+			u.Host = src
+			u.Path = ""
 		}
 		}
 		fmt.Fprintf(stdout, "Downloading from %s\n", u.String())
 		fmt.Fprintf(stdout, "Downloading from %s\n", u.String())
 		// Download with curl (pretty progress bar)
 		// Download with curl (pretty progress bar)