QuickRouter · 人工操作教材 · 非目标产品 UI / 非模型会话日志

Codex review 教程 · 配置与操作材料

review-request.md

Review uncommitted changes, only for path containment and percent-encoding input. Return file, exact line, trigger, evidence and uncertainty. Do not modify files. Do not post comments remotely.

route.py

from pathlib import Path
from urllib.parse import unquote
ROOT=Path(__file__).resolve().parent/'sandbox/downloads'
def broken(name):
    return (ROOT/unquote(name)).read_text()
def fixed(name):
    candidate=(ROOT/unquote(name)).resolve()
    if not candidate.is_relative_to(ROOT.resolve()):
        raise PermissionError('outside downloads root')
    if not candidate.is_file():
        raise FileNotFoundError(name)
    return candidate.read_text()