*(home): fix golint issues

This commit is contained in:
Andrey Meshkov 2019-09-18 00:26:58 +03:00 committed by Simon Zolin
parent d7f256ba7f
commit 4e76013334
3 changed files with 18 additions and 3 deletions

View File

@ -90,7 +90,7 @@ func (a *Auth) loadSessions() {
} }
_ = bkt.ForEach(forEach) _ = bkt.ForEach(forEach)
if removed != 0 { if removed != 0 {
tx.Commit() _ = tx.Commit()
} }
log.Debug("Auth: loaded %d sessions from DB (removed %d expired)", len(a.sessions), removed) log.Debug("Auth: loaded %d sessions from DB (removed %d expired)", len(a.sessions), removed)
} }
@ -321,6 +321,7 @@ func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.Re
if err == nil { if err == nil {
r := config.auth.CheckSession(cookie.Value) r := config.auth.CheckSession(cookie.Value)
if r == 0 { if r == 0 {
ok = true ok = true
} else if r < 0 { } else if r < 0 {
log.Debug("Auth: invalid cookie value: %s", cookie) log.Debug("Auth: invalid cookie value: %s", cookie)

View File

@ -35,7 +35,21 @@ var serviceRulesArray = []svc{
{"vk", []string{"||vk.com^"}}, {"vk", []string{"||vk.com^"}},
{"steam", []string{"||steam.com^"}}, {"steam", []string{"||steam.com^"}},
{"mail_ru", []string{"||mail.ru^"}}, {"mail_ru", []string{"||mail.ru^"}},
{"tiktok", []string{"||tiktok.com^", "||snssdk.com^", "||amemv.com^", "||toutiao.com^", "||ixigua.com^", "||pstatp.com^", "||ixiguavideo.com^", "||toutiaocloud.com^", "||toutiaocloud.net^", "||bdurl.com^", "||bytecdn.cn^", "||byteimg.com^", "||ixigua.com^"}}, {"tiktok", []string{
"||tiktok.com^",
"||snssdk.com^",
"||amemv.com^",
"||toutiao.com^",
"||ixigua.com^",
"||pstatp.com^",
"||ixiguavideo.com^",
"||toutiaocloud.com^",
"||toutiaocloud.net^",
"||bdurl.com^",
"||bytecdn.cn^",
"||byteimg.com^",
"||ixigua.com^",
}},
} }
// convert array to map // convert array to map

View File

@ -378,7 +378,7 @@ func (clients *clientsContainer) addFromDHCP() {
if len(l.Hostname) == 0 { if len(l.Hostname) == 0 {
continue continue
} }
config.clients.AddHost(l.IP.String(), l.Hostname, ClientSourceDHCP) _, _ = config.clients.AddHost(l.IP.String(), l.Hostname, ClientSourceDHCP)
} }
} }