Add request middleware to log incoming form params
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"log"
|
||||
"mime"
|
||||
"path/filepath"
|
||||
|
||||
@@ -76,6 +77,15 @@ func dbCheckMiddleware() gin.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// Middleware function to print out request parameters and body for debugging
|
||||
func requestInspectMiddleware() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
err := c.Request.ParseForm()
|
||||
|
||||
log.Println("Request params:", err, c.Request.Form)
|
||||
}
|
||||
}
|
||||
|
||||
func serveStaticAsset(path string, c *gin.Context) {
|
||||
data, err := data.Asset("static" + path)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user