mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-24 00:37:49 +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 len(newjson) > 16384 {
|
||||
return errors.New("Metadata exceeds max length of 16384 bytes")
|
||||
}
|
||||
m.myMetadata = newjson
|
||||
return nil
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user