Browse code

change content-type and small fix in run

Victor Vieux authored on 2013/05/09 01:36:37
Showing 2 changed files
... ...
@@ -100,7 +100,7 @@ func getContainersExport(srv *Server, w http.ResponseWriter, r *http.Request) ([
100 100
 		return nil, err
101 101
 	}
102 102
 	defer in.Close()
103
-	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
103
+	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
104 104
 	if err := srv.ContainerExport(name, out); err != nil {
105 105
 		fmt.Fprintf(out, "Error: %s\n", err)
106 106
 		return nil, err
... ...
@@ -120,7 +120,7 @@ func getImages(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, err
120 120
 			return nil, err
121 121
 		}
122 122
 		defer in.Close()
123
-		fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
123
+		fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
124 124
 		if err := srv.ImagesViz(out); err != nil {
125 125
 			fmt.Fprintf(out, "Error: %s\n", err)
126 126
 		}
... ...
@@ -257,7 +257,7 @@ func postImages(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, er
257 257
 		return nil, err
258 258
 	}
259 259
 	defer in.Close()
260
-	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
260
+	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
261 261
 	if image != "" { //pull
262 262
 		registry := r.Form.Get("registry")
263 263
 		if err := srv.ImagePull(image, tag, registry, out); err != nil {
... ...
@@ -305,7 +305,7 @@ func postImagesInsert(srv *Server, w http.ResponseWriter, r *http.Request) ([]by
305 305
 		return nil, err
306 306
 	}
307 307
 	defer in.Close()
308
-	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
308
+	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
309 309
 	if err := srv.ImageInsert(name, url, path, out); err != nil {
310 310
 		fmt.Fprintf(out, "Error: %s\n", err)
311 311
 		return nil, err
... ...
@@ -328,7 +328,7 @@ func postImagesPush(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte
328 328
 		return nil, err
329 329
 	}
330 330
 	defer in.Close()
331
-	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
331
+	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
332 332
 	if err := srv.ImagePush(name, registry, out); err != nil {
333 333
 		fmt.Fprintln(out, "Error: %s\n", err)
334 334
 		return nil, err
... ...
@@ -342,7 +342,7 @@ func postBuild(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, err
342 342
 		return nil, err
343 343
 	}
344 344
 	defer in.Close()
345
-	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
345
+	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
346 346
 	if err := srv.ImageCreateFromFile(in, out); err != nil {
347 347
 		fmt.Fprintln(out, "Error: %s\n", err)
348 348
 		return nil, err
... ...
@@ -476,7 +476,7 @@ func postContainersAttach(srv *Server, w http.ResponseWriter, r *http.Request) (
476 476
 	}
477 477
 	defer in.Close()
478 478
 
479
-	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: raw-stream-hijack\r\n\r\n")
479
+	fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
480 480
 	if err := srv.ContainerAttach(name, logs, stream, stdin, stdout, stderr, in, out); err != nil {
481 481
 		fmt.Fprintf(out, "Error: %s\n", err)
482 482
 		return nil, err
... ...
@@ -1109,7 +1109,6 @@ func CmdRun(args ...string) error {
1109 1109
 		if err != nil {
1110 1110
 			return err
1111 1111
 		}
1112
-		return nil
1113 1112
 	}
1114 1113
 	if err != nil {
1115 1114
 		return err