From b7b9cd5db56e30e0bbdbf059259f39e8a25fb16e Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Tue, 18 Mar 2025 22:26:25 +0800 Subject: [PATCH] fix log print issues --- proxy/authpass.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/authpass.go b/proxy/authpass.go index c8a1095..6c2382c 100644 --- a/proxy/authpass.go +++ b/proxy/authpass.go @@ -12,13 +12,13 @@ func AuthPassThrough(c *app.RequestContext, cfg *config.Config, req *http.Reques if cfg.Auth.PassThrough { token := c.Query("token") if token != "" { - logDebug("%s %s %s %s %s Auth-PassThrough: token %s", c.ClientIP(), c.Request.Method, string(c.Path()), c.GetHeader, c.Request.Header.GetProtocol(), token) + logDebug("%s %s %s %s %s Auth-PassThrough: token %s", c.ClientIP(), c.Request.Method, string(c.Path()), c.UserAgent(), c.Request.Header.GetProtocol(), token) switch cfg.Auth.AuthMethod { case "parameters": if !cfg.Auth.Enabled { req.Header.Set("Authorization", "token "+token) } else { - logWarning("%s %s %s %s %s Auth-Error: Conflict Auth Method", c.ClientIP(), c.Request.Method, string(c.Path()), c.GetHeader, c.Request.Header.GetProtocol()) + logWarning("%s %s %s %s %s Auth-Error: Conflict Auth Method", c.ClientIP(), c.Request.Method, string(c.Path()), c.UserAgent(), c.Request.Header.GetProtocol()) // 500 Internal Server Error c.JSON(http.StatusInternalServerError, gin.H{"error": "Conflict Auth Method"}) return @@ -28,7 +28,7 @@ func AuthPassThrough(c *app.RequestContext, cfg *config.Config, req *http.Reques req.Header.Set("Authorization", "token "+token) } default: - logWarning("%s %s %s %s %s Invalid Auth Method / Auth Method is not be set", c.ClientIP(), c.Request.Method, string(c.Path()), c.GetHeader, c.Request.Header.GetProtocol()) + logWarning("%s %s %s %s %s Invalid Auth Method / Auth Method is not be set", c.ClientIP(), c.Request.Method, string(c.Path()), c.UserAgent(), c.Request.Header.GetProtocol()) // 500 Internal Server Error c.JSON(http.StatusInternalServerError, gin.H{"error": "Invalid Auth Method / Auth Method is not be set"}) return