From c6b40761255c881b8851ac096d5cc59b0c6be729 Mon Sep 17 00:00:00 2001 From: David Sissitka Date: Sun, 15 Sep 2013 18:40:29 -0700 Subject: [PATCH] Fixed HTTP imports. --- commands.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands.go b/commands.go index 62d42b9874..df33dfc306 100644 --- a/commands.go +++ b/commands.go @@ -795,11 +795,13 @@ func (cli *DockerCli) CmdImport(args ...string) error { v.Set("tag", tag) v.Set("fromSrc", src) - err := cli.stream("POST", "/images/create?"+v.Encode(), cli.in, cli.out, nil) - if err != nil { - return err + var in io.Reader + + if src == "-" { + in = cli.in } - return nil + + return cli.stream("POST", "/images/create?"+v.Encode(), in, cli.out, nil) } func (cli *DockerCli) CmdPush(args ...string) error {