Browse Source

Fix auth error return

Signed-off-by: p4u <p4u@dabax.net>
feature_chain_module
p4u 5 years ago
parent
commit
408457d65b
1 changed files with 6 additions and 16 deletions
  1. +6
    -16
      service/processHttp.go

+ 6
- 16
service/processHttp.go

@ -159,26 +159,16 @@ func claimHandler(w http.ResponseWriter, req *http.Request, op string) {
if len(c.ProofData) < 1 { if len(c.ProofData) < 1 {
resp.Error = true resp.Error = true
resp.Response = "proofData not provided" resp.Response = "proofData not provided"
reply(&resp, w)
return
}
var validProof bool
validProof, err = T.CheckProof([]byte(c.ClaimData), c.ProofData)
if validProof {
resp.Response = "valid"
} else { } else {
resp.Response = "invalid"
validProof, _ := T.CheckProof([]byte(c.ClaimData), c.ProofData)
if validProof {
resp.Response = "valid"
} else {
resp.Response = "invalid"
}
} }
} }
if err != nil {
resp.Error = true
resp.Response = fmt.Sprint(err)
log.Print(err)
reply(&resp, w)
return
}
reply(&resp, w) reply(&resp, w)
} }

Loading…
Cancel
Save