-
Notifications
You must be signed in to change notification settings - Fork 117
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
Improved URL Parsing #222
Improved URL Parsing #222
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
cmd/zrok/util.go
Outdated
func parseUrl(in string) (string, error) { | ||
// parse port-only urls | ||
if iv, err := strconv.ParseInt(in, 10, 0); err == nil { | ||
return fmt.Sprintf("http://127.0.0.1:%d", iv), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should test for < 65535, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like it should tell me that it's inferred 'http'. for example if i zrok share 443, i would have inferred https
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't expect it to infer HTTPS URL scheme if the arg is "443", but I would expect that if the arg was "https".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really like the way it's going. small nits on the port number inference but other than that lgtm!
Corrects this issue:
#211
And also supports URLs like:
9090
-> http://127.0.0.1:9090localhost:9090
-> http://127.0.0.1:9090https://localhost:9090
-> https://localhost:9090Should align more closely with what users will likely expect.