From 8fed600077d5b8d976adec27dfb822166ca7baa5 Mon Sep 17 00:00:00 2001 From: shin- Date: Tue, 2 Apr 2013 03:00:21 -0700 Subject: [PATCH] Fix for #307 --- auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/auth.go b/auth/auth.go index 2c282af218..2eb63b1d4a 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -1,7 +1,6 @@ package auth import ( - "bytes" "encoding/base64" "encoding/json" "errors" @@ -112,7 +111,8 @@ func Login(authConfig *AuthConfig) (string, error) { return "", errors.New(errMsg) } - b := bytes.NewReader(jsonBody) + // using `bytes.NewReader(jsonBody)` here causes the server to respond with a 411 status. + b := strings.NewReader(string(jsonBody)) req1, err := http.Post(REGISTRY_SERVER+"/v1/users", "application/json; charset=utf-8", b) if err != nil { errMsg = fmt.Sprintf("Server Error: %s", err)