Skip to content

Commit

Permalink
barebone: Support binary data in Script.post()
Browse files Browse the repository at this point in the history
  • Loading branch information
WorksButNotTested authored and oleavr committed Oct 20, 2024
1 parent 145aa81 commit 9c42d5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/barebone/script.vala
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ namespace Frida {

public void post (string json, Bytes? data) {
var json_val = ctx.make_string (json);
invoke_void (dispatch_message_func, { json_val }, runtime_obj);
var data_val = (data != null) ? ctx.make_array_buffer (data.get_data ()) : QuickJS.Null;
invoke_void (dispatch_message_func, { json_val, data_val }, runtime_obj);
ctx.free_value (data_val);
ctx.free_value (json_val);

perform_pending_io ();
Expand Down

0 comments on commit 9c42d5c

Please sign in to comment.