File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,11 @@ import (
14
14
)
15
15
16
16
type Transcoder interface {
17
+ // Validates and encodes to bytes a multiaddr that's in the string representation.
17
18
StringToBytes (string ) ([]byte , error )
19
+ // Validates and decodes to a string a multiaddr that's in the bytes representation.
18
20
BytesToString ([]byte ) (string , error )
21
+ // Validates bytes when parsing a multiaddr that's already in the bytes representation.
19
22
ValidateBytes ([]byte ) error
20
23
}
21
24
@@ -63,6 +66,9 @@ func ip6zoneStB(s string) ([]byte, error) {
63
66
if len (s ) == 0 {
64
67
return nil , fmt .Errorf ("empty ip6zone" )
65
68
}
69
+ if strings .Contains (s , "/" ) {
70
+ return nil , fmt .Errorf ("IPv6 zone ID contains '/': %s" , s )
71
+ }
66
72
return []byte (s ), nil
67
73
}
68
74
You can’t perform that action at this time.
0 commit comments