2
0

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:
Henrique Vicente
2021-05-17 02:11:29 +02:00
committed by Jack Christensen
parent ba924e5715
commit 9c2c389e06
7 changed files with 530 additions and 106 deletions
+7 -5
View File
@@ -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
}