mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::json: Enforce string type for member key on constructions.
This commit is contained in:
parent
ee8165dfd4
commit
8593d09c80
2 changed files with 4 additions and 3 deletions
|
@ -77,7 +77,7 @@ inline
|
|||
ircd::json::member::member(const object::member &m)
|
||||
:std::pair<value, value>
|
||||
{
|
||||
m.first, value { m.second, type(m.second) }
|
||||
{ m.first, json::STRING }, value { m.second, type(m.second) }
|
||||
}
|
||||
{}
|
||||
|
||||
|
@ -85,7 +85,7 @@ inline
|
|||
ircd::json::member::member(const string_view &k)
|
||||
:std::pair<value, value>
|
||||
{
|
||||
k, string_view{}
|
||||
{ k, json::STRING }, string_view{}
|
||||
}
|
||||
{}
|
||||
|
||||
|
|
|
@ -1398,7 +1398,8 @@ ircd::json::stringify(mutable_buffer &buf,
|
|||
size_t
|
||||
ircd::json::serialized(const object::member &member)
|
||||
{
|
||||
return serialized(member.first) + 1 + serialized(member.second);
|
||||
const json::value key{member.first, json::STRING};
|
||||
return serialized(key) + 1 + serialized(member.second);
|
||||
}
|
||||
|
||||
std::ostream &
|
||||
|
|
Loading…
Reference in a new issue