支持自部署需求管理、交付流程与飞书集成
This commit is contained in:
1 parent
2149aeb6ed
commit
51a2e548f2
152 files changed
+8652
-6394
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user