diff --git a/server/helper.go b/server/helper.go index 286e501..64ed9ab 100644 --- a/server/helper.go +++ b/server/helper.go @@ -2,11 +2,27 @@ package server import ( "net/http" + "path/filepath" "github.com/gin-gonic/gin" "github.com/rs/xid" ) +func DefaultSkipLog(c *gin.Context) bool { + switch filepath.Ext(c.Request.URL.Path) { + case ".css": + fallthrough + case ".woff2": + fallthrough + case ".map": + fallthrough + case ".js": + return true + default: + return false + } +} + type Response struct { Status int `json:"status"` ID string `json:"id"`