From: Maytham Alsudany Subject: Use 127.0.0.1 instead of localhost Forwarded: not-needed Autopkgtest tries to resolve localhost online, so setting 127.0.0.1 will avoid this. --- a/auth/login.go +++ b/auth/login.go @@ -99,7 +99,7 @@ defer ln.Close() // open a web browser and listen on the redirect URL port - conf.RedirectURL = fmt.Sprintf("http://localhost:%d", port) + conf.RedirectURL = fmt.Sprintf("http://127.0.0.1:%d", port) url := conf.AuthCodeURL(state, authCodeOpts...) err = a.OpenBrowser(url) if err != nil { --- a/auth/login_integration_test.go +++ b/auth/login_integration_test.go @@ -38,7 +38,7 @@ // The client ID corresponding to GCR's OAuth2 login page. expectedClientID = "99426463878-o7n0bshgue20tdpm25q4at0vs2mr4utq.apps.googleusercontent.com" expectedScope = "https://www.googleapis.com/auth/devstorage.read_write" - expectedHost = "localhost" + expectedHost = "127.0.0.1" expectedAuthPath = "/auth" expectedTokenPath = "/token" expectedGrantType = "authorization_code"