fix: Fix log printing issues caused by container log tracking switches (#9552)

This commit is contained in:
ssongliu 2025-07-17 17:51:23 +08:00 committed by GitHub
parent 6b673017c5
commit adce6103bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,13 +1,14 @@
package router
import (
"github.com/1Panel-dev/1Panel/core/init/proxy"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"github.com/1Panel-dev/1Panel/core/init/proxy"
"github.com/1Panel-dev/1Panel/core/app/api/v2/helper"
"github.com/1Panel-dev/1Panel/core/app/repo"
"github.com/1Panel-dev/1Panel/core/cmd/server/res"
@ -56,6 +57,11 @@ func Proxy() gin.HandlerFunc {
helper.ErrorWithDetail(c, http.StatusBadRequest, "ErrProxy", err)
return
}
defer func() {
if err := recover(); err != nil && err != http.ErrAbortHandler {
global.LOG.Debug(err)
}
}()
proxy.LocalAgentProxy.ServeHTTP(c.Writer, c.Request)
c.Abort()
return