Websocket module uses Bytes.unsafe_{of,to}_string improperly. For example, write_frame_to_buf's argument fr.content isn't owned and is modified by Bytes.set in xor, but Bytes.unsafe_of_string is applied to it. That is, when a user calls write_frame_to_buf, fr.content is unexpectedly modified.
This PR fixes the above issue. As far as I understand, all uses of Bytes.unsafe_{to,of}_string are applied to non-owned strings. So this PR fixes them to use the safe counterparts.
Websocket
module usesBytes.unsafe_{of,to}_string
improperly. For example,write_frame_to_buf
's argumentfr.content
isn't owned and is modified byBytes.set
inxor
, butBytes.unsafe_of_string
is applied to it. That is, when a user callswrite_frame_to_buf
,fr.content
is unexpectedly modified.This PR fixes the above issue. As far as I understand, all uses of
Bytes.unsafe_{to,of}_string
are applied to non-owned strings. So this PR fixes them to use the safe counterparts.