all: A few more interesting linter fixes (#5502)
A couple of minor bugs and simplifications
This commit is contained in:
@@ -37,7 +37,7 @@ func TestAuditService(t *testing.T) {
|
||||
// This event should not be logged, since we have stopped.
|
||||
events.Default.Log(events.ConfigSaved, "the third event")
|
||||
|
||||
result := string(buf.Bytes())
|
||||
result := buf.String()
|
||||
t.Log(result)
|
||||
|
||||
if strings.Contains(result, "first event") {
|
||||
|
||||
@@ -531,7 +531,6 @@ func corsMiddleware(next http.Handler, allowFrameLoading bool) http.Handler {
|
||||
|
||||
// For everything else, pass to the next handler
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -22,17 +22,17 @@ type locationEnum string
|
||||
// more meaningful.
|
||||
const (
|
||||
locConfigFile locationEnum = "config"
|
||||
locCertFile = "certFile"
|
||||
locKeyFile = "keyFile"
|
||||
locHTTPSCertFile = "httpsCertFile"
|
||||
locHTTPSKeyFile = "httpsKeyFile"
|
||||
locDatabase = "database"
|
||||
locLogFile = "logFile"
|
||||
locCsrfTokens = "csrfTokens"
|
||||
locPanicLog = "panicLog"
|
||||
locAuditLog = "auditLog"
|
||||
locGUIAssets = "GUIAssets"
|
||||
locDefFolder = "defFolder"
|
||||
locCertFile locationEnum = "certFile"
|
||||
locKeyFile locationEnum = "keyFile"
|
||||
locHTTPSCertFile locationEnum = "httpsCertFile"
|
||||
locHTTPSKeyFile locationEnum = "httpsKeyFile"
|
||||
locDatabase locationEnum = "database"
|
||||
locLogFile locationEnum = "logFile"
|
||||
locCsrfTokens locationEnum = "csrfTokens"
|
||||
locPanicLog locationEnum = "panicLog"
|
||||
locAuditLog locationEnum = "auditLog"
|
||||
locGUIAssets locationEnum = "GUIAssets"
|
||||
locDefFolder locationEnum = "defFolder"
|
||||
)
|
||||
|
||||
// Platform dependent directories
|
||||
|
||||
@@ -190,7 +190,7 @@ func reportData(cfg configIntf, m modelIntf, connectionsService connectionsIntf,
|
||||
res["upgradeAllowedPre"] = !(upgrade.DisabledByCompilation || noUpgradeFromEnv) && opts.AutoUpgradeIntervalH > 0 && opts.UpgradeToPreReleases
|
||||
|
||||
if version >= 3 {
|
||||
res["uptime"] = int(time.Now().Sub(startTime).Seconds())
|
||||
res["uptime"] = int(time.Since(startTime).Seconds())
|
||||
res["natType"] = connectionsService.NATType()
|
||||
res["alwaysLocalNets"] = len(opts.AlwaysLocalNets) > 0
|
||||
res["cacheIgnoredFiles"] = opts.CacheIgnoredFiles
|
||||
|
||||
Reference in New Issue
Block a user