mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 19:07:48 +08:00
commands(dht): base64 encode value in get
Otherwise, it seems that something is treating this as UTF8 and normalizing it? fix half of #3124 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
parent
76dc6f5662
commit
9027eaa426
@ -2,6 +2,7 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@ -469,7 +470,7 @@ Different key types can specify other 'best' rules.
|
||||
} else {
|
||||
notif.PublishQueryEvent(ctx, ¬if.QueryEvent{
|
||||
Type: notif.Value,
|
||||
Extra: string(val),
|
||||
Extra: base64.StdEncoding.EncodeToString(val),
|
||||
})
|
||||
}
|
||||
}()
|
||||
@ -489,7 +490,11 @@ Different key types can specify other 'best' rules.
|
||||
if verbose {
|
||||
fmt.Fprintf(out, "got value: '%s'\n", obj.Extra)
|
||||
} else {
|
||||
fmt.Fprintln(out, obj.Extra)
|
||||
res, err := base64.StdEncoding.DecodeString(obj.Extra)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out.Write(res)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user