Commit 183f8e7a authored by liugaoling's avatar liugaoling

authorization

parent ebbcfef9
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
"github.com/cesanta/docker_auth/auth_server/authz" "github.com/cesanta/docker_auth/auth_server/authz"
"encoding/json" "encoding/json"
"bytes" "bytes"
"strconv"
) )
const SuccessExitCode = 0 const SuccessExitCode = 0
...@@ -76,7 +77,8 @@ func HttpAuth(authReqInfo authz.AuthRequestInfo) bool { ...@@ -76,7 +77,8 @@ func HttpAuth(authReqInfo authz.AuthRequestInfo) bool {
body, _ := ioutil.ReadAll(resp.Body) body, _ := ioutil.ReadAll(resp.Body)
if resp.StatusCode == 200 { if resp.StatusCode == 200 {
return bool(string(body)) result, _ := strconv.ParseBool(string(body))
return result
} }
fmt.Println(string(body)) fmt.Println(string(body))
return false return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment