Skip to content

Commit

Permalink
Replace request and xhr with axios
Browse files Browse the repository at this point in the history
  • Loading branch information
mainnet-pat committed Aug 20, 2024
1 parent 536ee4a commit f8cb5c6
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 1,012 deletions.
461 changes: 112 additions & 349 deletions dist/src/main/ts/common/HttpClient.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions dist/src/main/ts/common/MoneroRpcConnection.js

Large diffs are not rendered by default.

352 changes: 46 additions & 306 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
"@types/node": "^20.6.0",
"ajv": "^6.12.6",
"async": "2.6.4",
"axios": "^1.7.4",
"crypto-js": "^4.0.0",
"memfs": "^4.11.1",
"net": "^1.0.2",
"promise-throttle": "^1.1.2",
"request": "^2.88.0",
"request-promise": "^4.2.6",
"serialize-javascript": "^3.1.0",
"text-encoding": "^0.7.0",
"tls": "0.0.1",
Expand Down
2 changes: 0 additions & 2 deletions src/main/cpp/http_client_wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ EM_JS(const char*, js_send_json_request, (const char* uri, const char* username,
body: UTF8ToString(body),
resolveWithFullResponse: true,
rejectUnauthorized: LibraryUtils.isRejectUnauthorized(UTF8ToString(reject_unauthorized_fn_id)),
requestApi: GenUtils.isFirefox() ? "xhr" : "fetch" // firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1491010
}).then(resp => {

// build response container
Expand Down Expand Up @@ -96,7 +95,6 @@ EM_JS(const char*, js_send_binary_request, (const char* uri, const char* usernam
body: view,
resolveWithFullResponse: true,
rejectUnauthorized: LibraryUtils.isRejectUnauthorized(UTF8ToString(reject_unauthorized_fn_id)),
requestApi: GenUtils.isFirefox() ? "xhr" : "fetch" // firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1491010
}).then(resp => {

// write binary body to heap to pass back pointer
Expand Down
Loading

0 comments on commit f8cb5c6

Please sign in to comment.