From 3c263ea83598bb39d2ff9d760e6464e839664946 Mon Sep 17 00:00:00 2001 From: mark wu Date: Fri, 15 Dec 2023 17:08:21 +0800 Subject: [PATCH] No need to check http log instance --- internal/handler/site/handler.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/handler/site/handler.go b/internal/handler/site/handler.go index 731442b..0331043 100644 --- a/internal/handler/site/handler.go +++ b/internal/handler/site/handler.go @@ -137,10 +137,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.logger.Debug("resolved site", zap.String("site", handler.ID())) entry := middleware.GetLogEntry(r) - if entry != nil { - e := entry.(*httputil.LogEntry) - e.Logger = e.Logger.With(zap.String("site", handler.ID())) - } + e := entry.(*httputil.LogEntry) + e.Logger = e.Logger.With(zap.String("site", handler.ID())) if err := h.checkAuthz(r, handler); err != nil { http.NotFound(w, r)