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

Multiple enhancements #6

Merged
merged 14 commits into from
Dec 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed a minor bug where the CLI would ignore empty server URL
icereed committed Nov 27, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit ce25f3cebfd67b1100be430369a29bb14bfb1063
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -202,7 +202,7 @@ func main() {
}

func getSanitizedUrl(url string) string {
if !strings.HasPrefix(url, "https://") && !strings.HasPrefix(url, "http://") {
if url != "" && !strings.HasPrefix(url, "https://") && !strings.HasPrefix(url, "http://") {
url = "http://" + url
icereed marked this conversation as resolved.
Show resolved Hide resolved
}

1 change: 1 addition & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ func Test_getSanitizedUrl(t *testing.T) {
{"Has http://", "http://google.de", "http://google.de"},
{"Has https://", "https://google.de", "https://google.de"},
{"Has no protocol", "google.de", "http://google.de"},
{"Is empty", "", ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {