╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ web.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
3098 out.* = self.auto_login orelse return false; 3099 return true; 3100 } 3101 3102 const auto_login_name = "auto-login"; 3103 3104 // a token is exactly token_hex_len hex chars. validating before using the 3105 // value as a path keeps attacker-supplied cookies from escaping the 3106 // sessions dir (e.g. via "/" or ".." bytes). 3107 fn isToken(token_hex: []const u8) bool { 3108 if (token_hex.len != token_hex_len) return false; 3109 for (token_hex) |c| if (!std.ascii.isHex(c)) return false; 3110 return true; 3111 } 3112 }; 3113