Commit 9b54af20 authored by Gustavo Niemeyer's avatar Gustavo Niemeyer

exp/proxy: fix build after URL changes

R=golang-dev
CC=golang-dev
https://golang.org/cl/5540062
parent dafd9f0b
......@@ -11,7 +11,6 @@ import (
"net"
"net/url"
"os"
"strings"
)
// A Dialer is a means to establish a connection.
......@@ -70,14 +69,11 @@ func RegisterDialerType(scheme string, f func(*url.URL, Dialer) (Dialer, error))
// Dialer for it to make network requests.
func FromURL(u *url.URL, forward Dialer) (Dialer, error) {
var auth *Auth
if len(u.RawUserinfo) > 0 {
if u.User != nil {
auth = new(Auth)
parts := strings.SplitN(u.RawUserinfo, ":", 1)
if len(parts) == 1 {
auth.User = parts[0]
} else if len(parts) >= 2 {
auth.User = parts[0]
auth.Password = parts[1]
auth.User = u.User.Username()
if p, ok := u.User.Password(); ok {
auth.Password = p
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment