fix encoding of metadata containing newlines
This fixes a reversion in the ByteString conversion. The old code used isSpace to decide when the metadata value needs to be base64 encoded, and that incorrectly changed to only checking if it contained ' '. Note that only '\n' and '\r' were added and not other sorts of whitespace that isSpace matches, like '\t' and '\v'. Only the former would cause problems.
This commit is contained in:
parent
1a29d64bec
commit
d839c2110a
2 changed files with 8 additions and 1 deletions
|
@ -136,7 +136,7 @@ instance MetaSerializable MetaField where
|
|||
instance MetaSerializable MetaValue where
|
||||
serialize (MetaValue isset v) =
|
||||
serialize isset <>
|
||||
if B8.any (== ' ') v || "!" `B8.isPrefixOf` v
|
||||
if B8.any (`elem` [' ', '\r', '\n']) v || "!" `B8.isPrefixOf` v
|
||||
then "!" <> toB64' v
|
||||
else v
|
||||
deserialize b = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue