File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ module Frame = struct
90
90
{ opcode; extension; final; content }
91
91
92
92
let of_bytes ?opcode ?extension ?final content =
93
- let content = Bytes. unsafe_to_string content in
93
+ let content = Bytes. to_string content in
94
94
create ?opcode ?extension ?final ~content ()
95
95
96
96
let close code =
@@ -227,7 +227,7 @@ module Make (IO : Cohttp.S.IO) = struct
227
227
let write_frame_to_buf ~mode buf fr =
228
228
let scratch = Bytes. create 8 in
229
229
let open Frame in
230
- let content = Bytes. unsafe_of_string fr.content in
230
+ let content = Bytes. of_string fr.content in
231
231
let len = Bytes. length content in
232
232
let opcode = Opcode. to_enum fr.opcode in
233
233
let payload_len =
@@ -310,7 +310,7 @@ module Make (IO : Cohttp.S.IO) = struct
310
310
match payload with
311
311
| None -> proto_error " could not read payload (len=%d)" payload_len
312
312
| Some payload ->
313
- let payload = Bytes. unsafe_of_string payload in
313
+ let payload = Bytes. of_string payload in
314
314
if frame_masked then xor mask payload;
315
315
let frame = Frame. of_bytes ~opcode ~extension ~final payload in
316
316
return frame)
You can’t perform that action at this time.
0 commit comments