支持自部署需求管理、交付流程与飞书集成

This commit is contained in:
xyt committed 2026-11-25 12:40:33 +08:00
1 parent 4556a5b483
commit e22b66d9dd
148 files changed
+8300 -6393

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
/** Only app-relative navigation is accepted, including after an OAuth round trip. */
export function safeReturnTo(value: unknown): string {
if (typeof value !== 'string' || value.length > 2048 || !value.startsWith('/') || value.startsWith('//') || /[\\\u0000-\u0020\u007f]/.test(value)) return '/';
const url = new URL(value, 'https://local.invalid');
if (url.origin !== 'https://local.invalid' || url.pathname.startsWith('//') || url.pathname.startsWith('/api/') || url.pathname === '/login') return '/';
return url.pathname + url.search + url.hash;
}