╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ web.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
848 self.dir.deleteFile(self.io, token_hex) catch {}; 849 } 850 851 // a token is exactly token_hex_len hex chars. validating before using the 852 // value as a path keeps attacker-supplied cookies from escaping the 853 // sessions dir (e.g. via "/" or ".." bytes). 854 fn isToken(token_hex: []const u8) bool { 855 if (token_hex.len != token_hex_len) return false; 856 for (token_hex) |c| if (!std.ascii.isHex(c)) return false; 857 return true; 858 } 859 }; 860