From 7e9413b76414cea785fe26179f1cc4737b40b17d Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Tue, 13 Apr 2021 20:28:19 +0800 Subject: [PATCH] Fix 4566: add exceptMethods --- server/web/router.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/server/web/router.go b/server/web/router.go index 5a663386..7e78c76c 100644 --- a/server/web/router.go +++ b/server/web/router.go @@ -67,14 +67,21 @@ var ( "LOCK": true, "UNLOCK": true, } - // these beego.Controller's methods shouldn't reflect to AutoRouter - exceptMethod = []string{"Init", "Prepare", "Finish", "Render", "RenderString", - "RenderBytes", "Redirect", "Abort", "StopRun", "UrlFor", "ServeJSON", "ServeJSONP", - "ServeYAML", "ServeXML", "Input", "ParseForm", "GetString", "GetStrings", "GetInt", "GetBool", - "GetFloat", "GetFile", "SaveToFile", "StartSession", "SetSession", "GetSession", - "DelSession", "SessionRegenerateID", "DestroySession", "IsAjax", "GetSecureCookie", - "SetSecureCookie", "XsrfToken", "CheckXsrfCookie", "XsrfFormHtml", - "GetControllerAndAction", "ServeFormatted"} + // these web.Controller's methods shouldn't reflect to AutoRouter + exceptMethod = []string{"Abort", "CheckXSRFCookie", "CustomAbort", "DelSession", + "DestroySession", "Finish", "GetBool", "GetControllerAndAction", + "GetFile", "GetFiles", "GetFloat", "GetInt", "GetInt16", + "GetInt32", "GetInt64", "GetInt8", "GetSecureCookie", "GetSession", + "GetString", "GetStrings", "GetUint16", "GetUint32", "GetUint64", + "GetUint8", "HandlerFunc", "Init", "Input", + "IsAjax", "Mapping", "ParseForm", + "Prepare", "Redirect", "Render", "RenderBytes", + "RenderString", "SaveToFile", "SaveToFileWithBuffer", "SaveToFileWithBuffer", + "ServeFormatted", "ServeJSON", "ServeJSONP", "ServeXML", "ServeYAML", + "SessionRegenerateID", "SetData", "SetSecureCookie", "SetSession", "StartSession", + "StopRun", "URLFor", "URLMapping", "XSRFFormHTML", + "XSRFToken", + } urlPlaceholder = "{{placeholder}}" // DefaultAccessLogFilter will skip the accesslog if return true