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

Port should always default to 4200 if not specified #440

Open
proddata opened this issue May 3, 2024 · 0 comments
Open

Port should always default to 4200 if not specified #440

proddata opened this issue May 3, 2024 · 0 comments

Comments

@proddata
Copy link
Member

proddata commented May 3, 2024

It is confusing that without providing a dedicated port, we don't default to 4200 in all cases, e.g. when specifying to use TLS

e.g.

crash --hosts 'host' --> http://host:4200
crash --hosts 'http://host' --> http://host:80
crash --hosts 'https://host' --> https://host:443
crash --hosts 'https://host:4200' --> https://host:4200

they should all default to port 4200

crash --hosts 'host' --> http://host:4200
crash --hosts 'http://host' --> http://host:4200
crash --hosts 'https://host' --> https://host:4200
crash --hosts 'https://host:4200' --> https://host:4200

This probably will need some improvement here as we just split : 🙈

if ':' in host_or_port:
if len(host_or_port) == 1:
return 'localhost:4200'
elif host_or_port.startswith(':'):
return 'localhost' + host_or_port
return host_or_port
return host_or_port + ':4200'

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