INNER CODE UNIT · Python

_redirect

iLearn-Lab/NovelClaw · apps/multiagent/local_web_portal/app/main.py:205

def _redirect(path: str, **query: str) -> RedirectResponse:
    parts = urlsplit(path)
    params = dict(parse_qsl(parts.query, keep_blank_values=True))
    for key, value in query.items():
        if value is None:
            continue
        params[key] = str(value)
    target_path = _app_path(parts.path)
    target = urlunsplit(
        (
            parts.scheme,
            parts.netloc,
            target_path,
            urlencode(params, doseq=True),
            parts.fragment,
        )
    )
    return RedirectResponse(target, status_code=status.HTTP_303_SEE_OTHER)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…