Show Query params for invalid URL's
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ func (c *MainController) Get() {
|
|||||||
func (c *MainController) Error404() {
|
func (c *MainController) Error404() {
|
||||||
if beego.BConfig.RunMode != beego.PROD || beego.BConfig.Log.AccessLogs {
|
if beego.BConfig.RunMode != beego.PROD || beego.BConfig.Log.AccessLogs {
|
||||||
r := c.Ctx.Request
|
r := c.Ctx.Request
|
||||||
devInfo := fmt.Sprintf(" | %-10s | %-40s | %-16s | %-10s |", r.Method, r.URL.Path, " ", "notmatch")
|
devInfo := fmt.Sprintf("| %-10s | %-40s | %-16s", r.Method, r.URL.Path, r.URL.RawQuery)
|
||||||
if beego.DefaultAccessLogFilter == nil || !beego.DefaultAccessLogFilter.Filter(c.Ctx) {
|
if beego.DefaultAccessLogFilter == nil || !beego.DefaultAccessLogFilter.Filter(c.Ctx) {
|
||||||
beego.Warn(devInfo)
|
beego.Warn(devInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
beego.BConfig.Log.FileLineNum = false
|
||||||
if beego.BConfig.RunMode == "dev" {
|
if beego.BConfig.RunMode == "dev" {
|
||||||
beego.BConfig.WebConfig.DirectoryIndex = true
|
beego.BConfig.WebConfig.DirectoryIndex = true
|
||||||
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
||||||
|
|||||||
Reference in New Issue
Block a user