Skip to content

Commit 122579b

Browse files
authored
api: fix error checking bug in IP code (#55)
1 parent d3e9f91 commit 122579b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func ipFromRequest(r *http.Request) string {
7676
}
7777

7878
host, _, err := net.SplitHostPort(r.RemoteAddr)
79-
if err != nil {
79+
if err == nil {
8080
return host
8181
}
8282

0 commit comments

Comments
 (0)