diff --git a/CHANGELOG.md b/CHANGELOG.md index 1825be6..2f947c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 更新日志 +25w01c +--- +- PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用 +- CHANGE: 改进token参数透传功能 + 25w01b --- - PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用 diff --git a/DEV-VERSION b/DEV-VERSION index 2f8a75c..3fb0839 100644 --- a/DEV-VERSION +++ b/DEV-VERSION @@ -1 +1 @@ -25w01b \ No newline at end of file +25w01c \ No newline at end of file diff --git a/proxy/proxy.go b/proxy/proxy.go index 1238358..1704dc2 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -286,6 +286,9 @@ func authPassThrough(c *gin.Context, cfg *config.Config, req *req.Request) { req.SetHeader("Authorization", "token "+token) } else { logWarning("%s %s %s %s %s Auth-Error: Conflict Auth Method", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto) + // 500 Internal Server Error + c.JSON(http.StatusInternalServerError, gin.H{"error": "Conflict Auth Method"}) + return } case "header": if cfg.Auth.Enabled { @@ -293,6 +296,9 @@ func authPassThrough(c *gin.Context, cfg *config.Config, req *req.Request) { } default: logWarning("%s %s %s %s %s Invalid Auth Method / Auth Method is not be set", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto) + // 500 Internal Server Error + c.JSON(http.StatusInternalServerError, gin.H{"error": "Invalid Auth Method / Auth Method is not be set"}) + return } } }