mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
fix handling of request bodies
This commit is contained in:
parent
3a50060e07
commit
5e9f26f818
6 changed files with 32 additions and 8 deletions
|
@ -77,10 +77,15 @@ function data_to_array(data) {
|
|||
function c_func(target, args=[]) {
|
||||
let str_pointers = [];
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
if (typeof args[i] !== "string") {
|
||||
continue;
|
||||
let ptr = null;
|
||||
if (typeof args[i] === "string") {
|
||||
ptr = allocate_str(args[i]);
|
||||
}
|
||||
let ptr = allocate_str(args[i]);
|
||||
if (args[i] instanceof Uint8Array) {
|
||||
ptr = allocate_array(args[i]);
|
||||
}
|
||||
|
||||
if (!ptr) continue;
|
||||
args[i] = ptr;
|
||||
str_pointers.push(ptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue