auth: fix nil dereference crash

Change-Id: I4552829da795236b9c875a753b6f1d710066d89a
This commit is contained in:
Brad Fitzpatrick 2012-12-01 10:54:14 -08:00
parent 48bd05ad8d
commit 2f072dfc20
1 changed files with 2 additions and 2 deletions

View File

@ -163,11 +163,11 @@ func localhostAuthorized(req *http.Request) bool {
uid := os.Getuid()
from, err := netutil.HostPortToIP(req.RemoteAddr)
if err != nil {
fmt.Printf("auth: could not resolve the TCPAddr: %v", err)
return false
}
to, err := netutil.HostPortToIP(req.Host)
if err != nil {
fmt.Printf("auth: could not resolve the TCPAddr: %v", err)
return false
}
// If our OS doesn't support uid.