json: fix implementation of json Unmarshalers.
* AuthenticationMD5Password was wrong and is not needed * Bind was wrong * ErrorResponse is not needed * Minor improvements for reliability
This commit is contained in:
committed by
Jack Christensen
parent
ba924e5715
commit
9c2c389e06
@@ -82,11 +82,13 @@ func (dst *SASLInitialResponse) UnmarshalJSON(data []byte) error {
|
||||
if err := json.Unmarshal(data, &msg); err != nil {
|
||||
return err
|
||||
}
|
||||
decodedData, err := hex.DecodeString(msg.Data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dst.AuthMechanism = msg.AuthMechanism
|
||||
dst.Data = decodedData
|
||||
if msg.Data != "" {
|
||||
decoded, err := hex.DecodeString(msg.Data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dst.Data = decoded
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user