Skip to content

fix(wasm): websocket url validation#2096

Merged
shamardy merged 4 commits intodevfrom
fix-wbsocket-url-parsing
Apr 12, 2024
Merged

fix(wasm): websocket url validation#2096
shamardy merged 4 commits intodevfrom
fix-wbsocket-url-parsing

Conversation

@borngraced
Copy link

@borngraced borngraced commented Apr 12, 2024

This test kept failing because If you give a partial or incomplete URL to the WebSocket::new constructor, the browser tries to fix it by adding it to the current page's web address.

For our test case, Websocket::new("invalid address") will return this URL ws://127.0.0.1:52732/invalid%20address as the webpage is being hosted on my pc using port 52732.

https://github.com/KomodoPlatform/komodo-defi-framework/blob/f0b21dccacb846510e2eb8f2150b1fd02fffd9dd/mm2src/mm2_net/src/wasm/wasm_ws.rs#L782-L795

@borngraced borngraced self-assigned this Apr 12, 2024
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! only one comment!

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shamardy shamardy merged commit 3e44c15 into dev Apr 12, 2024
@shamardy shamardy deleted the fix-wbsocket-url-parsing branch April 12, 2024 17:25
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Apr 16, 2024
* dev:
  fix(tests): fix failing tests (GLEECBTC#2085)
  fix(wasm): websocket url validation (GLEECBTC#2096)
  deps(zcoin): use librustzcash that uses the same `aes` version as mm2 (GLEECBTC#2095)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants