Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nem.utils.helper.formatEndpoint should not add ':' when port is empty #47

Open
Alexhuszagh opened this issue Jun 2, 2018 · 0 comments

Comments

@Alexhuszagh
Copy link

Alexhuszagh commented Jun 2, 2018

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).

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

No branches or pull requests

1 participant