fix urls: Escape values in URLs

For usernames and passwords containing special characters the URL parameters
must be escaped.

Because the entire URI is just query parameters I've opted for using net/url.Values
for the entire URI.

Fixes #1
This commit is contained in:
Vincent Ambo 2017-02-13 09:55:24 +01:00
parent 7824e0e7e3
commit 6dcb0f4b2b
2 changed files with 25 additions and 6 deletions

View file

@ -62,6 +62,7 @@ func readCredentials() (string, string, error) {
fmt.Printf("Password: ")
password, err := terminal.ReadPassword(syscall.Stdin)
fmt.Println()
// If an error occured, I don't care about which one it is.
return strings.TrimSpace(username), strings.TrimSpace(string(password)), err