test logs
This commit is contained in:
parent
6002b594c6
commit
1846f121bf
|
|
@ -18,6 +18,16 @@ func (a *App) authMiddleware(c *fiber.Ctx) error {
|
|||
c.Locals("ip_address", ip)
|
||||
c.Locals("user_agent", userAgent)
|
||||
authHeader := c.Get("Authorization")
|
||||
fmt.Println("--------------------------------")
|
||||
fmt.Println("All Headers:")
|
||||
allHeaders := c.GetReqHeaders()
|
||||
for key, value := range allHeaders {
|
||||
fmt.Printf(" %s: %s\n", key, value)
|
||||
}
|
||||
fmt.Println("userAgent", userAgent)
|
||||
fmt.Println("ip", ip)
|
||||
fmt.Println("authHeader", authHeader)
|
||||
fmt.Println("--------------------------------")
|
||||
if authHeader == "" {
|
||||
a.mongoLoggerSvc.Info("Authorization header missing",
|
||||
zap.Int("status_code", fiber.StatusUnauthorized),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user