mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-12-23 02:55:39 +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…
Reference in New Issue
Block a user