Pass user/pass for HTTP Basic Authentication in URL parameters (#2469)

This commit is contained in:
pkrolikowski
2017-03-10 13:19:23 +01:00
committed by Vishal Nayak
parent ef94004ad7
commit ee177d85f8
2 changed files with 2 additions and 0 deletions

View File

@@ -333,6 +333,7 @@ func (c *Client) NewRequest(method, path string) *Request {
req := &Request{
Method: method,
URL: &url.URL{
User: c.addr.User,
Scheme: c.addr.Scheme,
Host: c.addr.Host,
Path: path,

View File

@@ -55,6 +55,7 @@ func (r *Request) ToHTTP() (*http.Request, error) {
return nil, err
}
req.URL.User = r.URL.User
req.URL.Scheme = r.URL.Scheme
req.URL.Host = r.URL.Host
req.Host = r.URL.Host