Skip to content

Commit 0dea8cc

Browse files
committed
escape user/pass
Necessary since Go 1.9.3 golang/go#23392
1 parent f4e840e commit 0dea8cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jsonfxns.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"io"
1515
"io/ioutil"
1616
"net/http"
17+
"net/url"
1718
"strings"
1819
)
1920

@@ -51,6 +52,8 @@ func jsonRpcSend(user string, password string, server string, message []byte,
5152
client.Transport = transport
5253
protocol = "https"
5354
}
55+
user = url.PathEscape(user)
56+
password = url.PathEscape(password)
5457
credentials := user + ":" + password
5558
resp, err := client.Post(protocol+"://"+credentials+"@"+server,
5659
"application/json", bytes.NewReader(message))

0 commit comments

Comments
 (0)