mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-08-09 04:31:47 +02:00
stop decoding strings unsafely.
This commit is contained in:
@@ -39,9 +39,9 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event)
|
|||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "id":
|
case "id":
|
||||||
out.ID = in.UnsafeString()
|
out.ID = in.String()
|
||||||
case "pubkey":
|
case "pubkey":
|
||||||
out.PubKey = in.UnsafeString()
|
out.PubKey = in.String()
|
||||||
case "created_at":
|
case "created_at":
|
||||||
out.CreatedAt = Timestamp(in.Int64())
|
out.CreatedAt = Timestamp(in.Int64())
|
||||||
case "kind":
|
case "kind":
|
||||||
@@ -91,9 +91,9 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event)
|
|||||||
in.Delim(']')
|
in.Delim(']')
|
||||||
}
|
}
|
||||||
case "content":
|
case "content":
|
||||||
out.Content = in.UnsafeString()
|
out.Content = in.String()
|
||||||
case "sig":
|
case "sig":
|
||||||
out.Sig = in.UnsafeString()
|
out.Sig = in.String()
|
||||||
default:
|
default:
|
||||||
out.extra[key] = in.Interface()
|
out.extra[key] = in.Interface()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user