fix: reading headers in middleware modified to be case insensitive
This commit is contained in:
parent
1846f121bf
commit
87e57ca548
|
|
@ -17,7 +17,12 @@ func (a *App) authMiddleware(c *fiber.Ctx) error {
|
||||||
userAgent := c.Get("User-Agent")
|
userAgent := c.Get("User-Agent")
|
||||||
c.Locals("ip_address", ip)
|
c.Locals("ip_address", ip)
|
||||||
c.Locals("user_agent", userAgent)
|
c.Locals("user_agent", userAgent)
|
||||||
authHeader := c.Get("Authorization")
|
// Get Authorization header (case-insensitive)
|
||||||
|
authHeader := strings.TrimSpace(c.Get("Authorization"))
|
||||||
|
if authHeader == "" {
|
||||||
|
// Try lowercase as fallback
|
||||||
|
authHeader = strings.TrimSpace(c.Get("authorization"))
|
||||||
|
}
|
||||||
fmt.Println("--------------------------------")
|
fmt.Println("--------------------------------")
|
||||||
fmt.Println("All Headers:")
|
fmt.Println("All Headers:")
|
||||||
allHeaders := c.GetReqHeaders()
|
allHeaders := c.GetReqHeaders()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user