From 9f033fc8484095fd34b4cbadd69965b9acfa5d45 Mon Sep 17 00:00:00 2001 From: ading2210 Date: Thu, 11 Jul 2024 02:28:25 -0700 Subject: [PATCH] ensure the emscripten websocket url is set properly --- CHANGELOG.md | 3 +++ client/build.sh | 1 + client/javascript/main.js | 6 +++--- client/package.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7464273..74bdf14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Libcurl.js Changelog: +## v0.6.10 (7/11/24): +- Fix a problem where the websocket URL wouldn't be set properly in some cases + ## v0.6.9 (7/10/24): - Fix a possible double free when requests get aborted - Handle `ReadableStream` objects as the request payload diff --git a/client/build.sh b/client/build.sh index b26279f..6e71214 100755 --- a/client/build.sh +++ b/client/build.sh @@ -52,6 +52,7 @@ if [[ "$*" == *"release"* ]]; then else COMPILER_OPTIONS="$COMPILER_OPTIONS --profiling -g " EMSCRIPTEN_OPTIONS="$EMSCRIPTEN_OPTIONS -sSTACK_OVERFLOW_CHECK=2" + echo "note: this is a debug build" fi if [[ "$*" == *"asan"* ]]; then diff --git a/client/javascript/main.js b/client/javascript/main.js index 1e09b6d..b8ab599 100644 --- a/client/javascript/main.js +++ b/client/javascript/main.js @@ -43,9 +43,9 @@ function check_loaded(check_websocket) { } function set_websocket_url(url) { websocket_url = url; - if (Module.websocket) { - Module.websocket.url = url; - } + if (typeof Module.websocket === "undefined") + Module.websocket = {}; + Module.websocket.url = url; if (!main_session && wasm_ready) { setup_main_session(); } diff --git a/client/package.json b/client/package.json index 919fe24..33c83ed 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "libcurl.js", - "version": "0.6.9", + "version": "0.6.10", "description": "An experimental port of libcurl to WebAssembly for use in the browser.", "main": "libcurl.mjs", "exports": {