Merge pull request #4571 from flycash/fix4566

Fix 4566: add exceptMethods
This commit is contained in:
Ming Deng 2021-04-13 22:23:55 +08:00 committed by GitHub
commit 4df8804f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 8 deletions

12
.deepsource.toml Normal file
View File

@ -0,0 +1,12 @@
version = 1
test_patterns = ["**/*_test.go"]
exclude_patterns = ["scripts/**"]
[[analyzers]]
name = "go"
enabled = true
[analyzers.meta]
import_paths = ["github.com/beego/beego"]

View File

@ -67,14 +67,21 @@ var (
"LOCK": true, "LOCK": true,
"UNLOCK": true, "UNLOCK": true,
} }
// these beego.Controller's methods shouldn't reflect to AutoRouter // these web.Controller's methods shouldn't reflect to AutoRouter
exceptMethod = []string{"Init", "Prepare", "Finish", "Render", "RenderString", exceptMethod = []string{"Abort", "CheckXSRFCookie", "CustomAbort", "DelSession",
"RenderBytes", "Redirect", "Abort", "StopRun", "UrlFor", "ServeJSON", "ServeJSONP", "DestroySession", "Finish", "GetBool", "GetControllerAndAction",
"ServeYAML", "ServeXML", "Input", "ParseForm", "GetString", "GetStrings", "GetInt", "GetBool", "GetFile", "GetFiles", "GetFloat", "GetInt", "GetInt16",
"GetFloat", "GetFile", "SaveToFile", "StartSession", "SetSession", "GetSession", "GetInt32", "GetInt64", "GetInt8", "GetSecureCookie", "GetSession",
"DelSession", "SessionRegenerateID", "DestroySession", "IsAjax", "GetSecureCookie", "GetString", "GetStrings", "GetUint16", "GetUint32", "GetUint64",
"SetSecureCookie", "XsrfToken", "CheckXsrfCookie", "XsrfFormHtml", "GetUint8", "HandlerFunc", "Init", "Input",
"GetControllerAndAction", "ServeFormatted"} "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}}" urlPlaceholder = "{{placeholder}}"
// DefaultAccessLogFilter will skip the accesslog if return true // DefaultAccessLogFilter will skip the accesslog if return true