openziti / ziti-console

https://openziti.io
Apache License 2.0
23 stars 15 forks source link

don't crash when attaching to the wrong scheme #17

Closed dovholuknf closed 2 years ago

dovholuknf commented 2 years ago

see discourse at https://openziti.discourse.group/t/ziti-console-breaks-when-tryin-to-login-for-first-time/263

right now node is crashing when you supply http to an https endpoint. It shouldn't crash :) It should even maybe tell you "you probably screwed it up" somehow? :)

ecelis commented 2 years ago

I did peek at the code, if I wrap with try..catch the callback in GetPath in server.js to handle the error I prevent node crashing. Still need to look more to return some sort of error back to the user. Any pointers are welcome.

P.S. I can take over this, but not until weekend.

JeremyTellier commented 2 years ago

I pushed up a fix for it, there was a little more to do just to block the ability to ever add an invalid url in the first place, but it was basically what you said with some minor tweaks, thanks for the help!