0chain / blobber

A storage provider (blobber) interface to the blockchain and consumers of storage.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

revisit request validation

dabasov opened this issue · comments

commented

For every incoming request validate payloads, for example this logic causes panic() when proof is nil

	var challengeRequest ChallengeRequest
	decoder := json.NewDecoder(tReader)
	err := decoder.Decode(&challengeRequest)
	if err != nil {
		logging.Logger.Error("Error decoding the input to validator")
		return nil, "", common.NewError("input_decode_error", "Error in decoding the input."+err.Error())
	}

        challengeRequest.ChallengeProof

Also we need to add recovery to all the endpoints