Skip to content

Commit c124df3

Browse files
skinandboneszookzook
authored andcommitted
resolve decode problem for the Binary (Old) BinData subtype
1 parent 5b0ecae commit c124df3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/bson/decoder.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ defmodule BSON.Decoder do
4949
list(binary)
5050
end
5151

52+
defp type(@type_binary, <<_size::int32, subtype, length::int32, binary::binary(length), rest::binary>>) when subtype == 0x02 do
53+
subtype = subtype(subtype)
54+
{%BSON.Binary{binary: binary, subtype: subtype}, rest}
55+
end
56+
5257
defp type(@type_binary, <<size::int32, subtype, binary::binary(size), rest::binary>>) do
5358
subtype = subtype(subtype)
5459
{%BSON.Binary{binary: binary, subtype: subtype}, rest}

0 commit comments

Comments
 (0)