diff --git a/blobserver/go/camlistored.go b/blobserver/go/camlistored.go index 18baa2bdd..1db75e022 100644 --- a/blobserver/go/camlistored.go +++ b/blobserver/go/camlistored.go @@ -292,8 +292,17 @@ func handlePreUpload(conn *http.Conn, req *http.Request) { ret := make(map[string]interface{}) ret["maxUploadSize"] = 2147483647 // 2GB.. *shrug* ret["alreadyHave"] = haveVector.Copy() - ret["uploadUrl"] = "http://localhost:3179/camli/upload" ret["uploadUrlExpirationSeconds"] = 86400 + + if len(req.Host) > 0 { + scheme := "http" // TODO: https + ret["uploadUrl"] = fmt.Sprintf("%s://%s/camli/upload", + scheme, req.Host) + } else { + ret["uploadUrl"] = "/camli/upload" + } + + returnJson(conn, ret) }