mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 18:15:24 +00:00
Set max metadata size to 16kb
This commit is contained in:
parent
07c26176b6
commit
226c72df16
@ -104,6 +104,9 @@ func (m *metadata) setMetadata(given interface{}) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if newjson, err := json.Marshal(newmeta); err == nil {
|
if newjson, err := json.Marshal(newmeta); err == nil {
|
||||||
|
if len(newjson) > 16384 {
|
||||||
|
return errors.New("Metadata exceeds max length of 16384 bytes")
|
||||||
|
}
|
||||||
m.myMetadata = newjson
|
m.myMetadata = newjson
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user