on master help sign in
Simplify extractToken: inline rest binding
commit4cd62e44211d6bfd69ca60b3ca405ce8fb244143 authoriko <mail@iko.soy> dateMon 27 Apr 2026, 20:46 (5 months ago) parent3c2e545
1 file changed+2−3
server.knot+2−3
server.knot+2−3
@@ -597,9 +597,8 @@ isBadServerName = \sn ->
597597-- Plain ip match (sessions with empty ip skip the check).
598598matchIp = \clientIp sessionIp -> sessionIp == "" || clientIp == sessionIp
599599
600−extractToken = \authHeader ->
601− let rest = drop 7 authHeader in
602− if hasPrefix "Bearer " authHeader && rest != "" then Just {value: rest} else Nothing {}
600+extractToken = \h ->
601+ if hasPrefix "Bearer " h && drop 7 h != "" then Just {value: drop 7 h} else Nothing {}
603602
604603verifyMaintenanceAuth : Text -> IO Bool
605604verifyMaintenanceAuth = \authorization -> do