Browse code

Use proper scheme with static registry Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby authored on 2014/04/29 18:01:07
Showing 1 changed files
... ...
@@ -6,7 +6,6 @@ import (
6 6
 	"encoding/json"
7 7
 	"errors"
8 8
 	"fmt"
9
-	"github.com/dotcloud/docker/utils"
10 9
 	"io"
11 10
 	"io/ioutil"
12 11
 	"net"
... ...
@@ -17,6 +16,8 @@ import (
17 17
 	"strconv"
18 18
 	"strings"
19 19
 	"time"
20
+
21
+	"github.com/dotcloud/docker/utils"
20 22
 )
21 23
 
22 24
 var (
... ...
@@ -372,7 +373,11 @@ func (r *Registry) GetRepositoryData(remote string) (*RepositoryData, error) {
372 372
 		}
373 373
 	} else {
374 374
 		// Assume the endpoint is on the same host
375
-		endpoints = append(endpoints, fmt.Sprintf("%s://%s/v1/", urlScheme, req.URL.Host))
375
+		u, err := url.Parse(indexEp)
376
+		if err != nil {
377
+			return nil, err
378
+		}
379
+		endpoints = append(endpoints, fmt.Sprintf("%s://%s/v1/", u.Scheme, req.URL.Host))
376 380
 	}
377 381
 
378 382
 	checksumsJSON, err := ioutil.ReadAll(res.Body)