commit 3558a050fa556e6a6342888b9ad60a04430b0277
parent edbf01c144c21676f0fab5f6ef97a4ed20deb0bf
Author: Florian Dold <florian@dold.me>
Date: Tue, 27 Feb 2024 18:43:37 +0100
-logic
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/quickjs/quickjs-http.c b/quickjs/quickjs-http.c
@@ -269,6 +269,8 @@ create_impl(void *cls, struct JSHttpRequestInfo *req_info)
assert(0);
}
+ printf("request body len %llu:\n", (unsigned long long) req_info->req_body_len);
+
if (0 == strcasecmp(req_info->method, "get")) {
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
} else if (0 == strcasecmp(method, "delete")) {
diff --git a/quickjs/quickjs-libc.c b/quickjs/quickjs-libc.c
@@ -2439,7 +2439,7 @@ static JSValue js_os_fetchHttp(JSContext *ctx, JSValueConst this_val,
if (JS_IsException(data)) {
goto exception;
}
- if (JS_IsNull(data) || JS_IsUndefined(data)) {
+ if (!(JS_IsNull(data) || JS_IsUndefined(data))) {
data_ptr = JS_GetArrayBuffer(ctx, &data_len, data);
if (!data_ptr) {
goto exception;