mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-03 21:43:06 +00:00
fix broken validation
This commit is contained in:
parent
04300cfb45
commit
ac6bfc1dd2
@ -10,7 +10,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
mh "github.com/multiformats/go-multihash"
|
mh "gx/ipfs/QmerPMzPk1mJVowm8KgmoknWa4yCYvvugMPsgWmDNUvDLW/go-multihash"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Transcoder interface {
|
type Transcoder interface {
|
||||||
@ -241,8 +241,8 @@ func garlic64BtS(b []byte) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func garlicValidate(b []byte) error {
|
func garlicValidate(b []byte) error {
|
||||||
if len(b) > 516 || len(b) < 616 {
|
if len(b) < 386 {
|
||||||
return fmt.Errorf("failed to parse garlic addr: %s not an i2p base64 address. len: %d\n", b, len(b))
|
return fmt.Errorf("failed to validate garlic addr: %s not an i2p base64 address. len: %d\n", b, len(b))
|
||||||
}
|
}
|
||||||
s, err := garlic64BtS(b)
|
s, err := garlic64BtS(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user