I'm using a proxy service for a demo React application, which proxies a node to a path relative to the application, say.
For example, say my node is at http://localhost:7890, and my proxy redirects this to http://localhost:3000/api/node, using the NEM-SDK's formatEndpoint converts this to http://localhost:3000/api/node/:, which is an invalid IP address.
The fix is trivial: simply check if the port is empty before adding the semicolon. It really would help for applications making use of the NEM SDK, particularly for those that require proxies to avoid CORs (Cross-Origin Requests).
I'm using a proxy service for a demo React application, which proxies a node to a path relative to the application, say.
For example, say my node is at
http://localhost:7890
, and my proxy redirects this tohttp://localhost:3000/api/node
, using the NEM-SDK'sformatEndpoint
converts this tohttp://localhost:3000/api/node/:
, which is an invalid IP address.The fix is trivial: simply check if the port is empty before adding the semicolon. It really would help for applications making use of the NEM SDK, particularly for those that require proxies to avoid CORs (Cross-Origin Requests).