hashgraph / hedera-sdk-js

Hedera™ Hashgraph SDK for JavaScript/TypeScript
https://docs.hedera.com/guides/docs/sdks
Apache License 2.0
277 stars 145 forks source link

Regex never matches port #793

Closed feri42 closed 2 years ago

feri42 commented 2 years ago

Description

The regexp here: https://github.com/hashgraph/hedera-sdk-js/blob/628258026122ac189ed28c503221bb17799e5cee/src/ManagedNodeAddress.js#L8 never matches the port part. Because of this isTransportSecurity() always returns false: https://github.com/hashgraph/hedera-sdk-js/blob/628258026122ac189ed28c503221bb17799e5cee/src/ManagedNodeAddress.js#L109

Steps to reproduce

Read the code

Additional context

No response

Hedera network

mainnet

Version

latest

Operating system

No response

janaakhterov commented 2 years ago

Can confirm this is a bug. I believe this was fixed in Java, but the fix was not ported to JS.

janaakhterov commented 2 years ago

Fixed directly on the develop branch with an accompanying test: https://github.com/hashgraph/hedera-sdk-js/blob/develop/test/unit/HostAndPort.js