mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-12-24 02:43:57 +08:00
all: imp style
This commit is contained in:
@@ -366,7 +366,6 @@ var _ httputil.Middleware = (*authMiddlewareDefault)(nil)
|
||||
func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
path := r.URL.Path
|
||||
|
||||
if !mw.needsAuthentication(ctx) {
|
||||
h.ServeHTTP(w, r)
|
||||
@@ -374,6 +373,7 @@ func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
|
||||
return
|
||||
}
|
||||
|
||||
path := r.URL.Path
|
||||
if mw.handleAuthenticatedUser(ctx, w, r, h, path) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -260,9 +260,9 @@ func finalizeWindowsUpdate(ctx context.Context,
|
||||
var commandConf *executil.CommandConfig
|
||||
|
||||
if runningAsService {
|
||||
// NOTE: We can't restart the service via "kardianos/service"
|
||||
// package, because it kills the process first we can't start a new
|
||||
// instance, because Windows doesn't allow it.
|
||||
// NOTE: We can't restart the service via "kardianos/service" package,
|
||||
// because it kills the process first we can't start a new instance,
|
||||
// because Windows doesn't allow it.
|
||||
//
|
||||
// TODO(a.garipov): Recheck the claim above.
|
||||
commandConf = &executil.CommandConfig{
|
||||
|
||||
@@ -678,7 +678,6 @@ func run(
|
||||
done chan struct{},
|
||||
sigHdlr *signalHandler,
|
||||
) {
|
||||
var err error
|
||||
initEnvironment(ctx, opts, slogLogger)
|
||||
|
||||
isFirstRun := detectFirstRun()
|
||||
@@ -687,7 +686,7 @@ func run(
|
||||
confPath, upd, isCustomURL := initUpdate(ctx, slogLogger, opts, tlsMgr, isFirstRun)
|
||||
|
||||
dataDir := globalContext.getDataDir()
|
||||
err = os.MkdirAll(dataDir, aghos.DefaultPermDir)
|
||||
err := os.MkdirAll(dataDir, aghos.DefaultPermDir)
|
||||
fatalOnError(errors.Annotate(err, "creating DNS data dir at %s: %w", dataDir))
|
||||
|
||||
auth, err := initUsers(ctx, slogLogger, opts.glinetMode)
|
||||
|
||||
Reference in New Issue
Block a user