test logs

This commit is contained in:
Kerod-Fresenbet-Gebremedhin2660 2026-01-12 09:26:49 +03:00
parent 6002b594c6
commit 1846f121bf
2 changed files with 10 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -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),