mirror of https://github.com/perkeep/perkeep.git
auth: fix nil dereference crash
Change-Id: I4552829da795236b9c875a753b6f1d710066d89a
This commit is contained in:
parent
48bd05ad8d
commit
2f072dfc20
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue