╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ web.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
3177 3178 const auto_login_name = "auto-login"; 3179 3180 // a token is exactly token_hex_len hex chars. validating before using the 3181 // value as a path keeps attacker-supplied cookies from escaping the 3182 // sessions dir (e.g. via "/" or ".." bytes). 3183 fn isToken(token_hex: []const u8) bool { 3184 if (token_hex.len != token_hex_len) return false; 3185 for (token_hex) |c| if (!std.ascii.isHex(c)) return false; 3186 return true; 3187 } 3188 }; 3189