fix(coding): remediate data service review findings

This commit is contained in:
2026-08-27 00:49:59 +08:00
parent 239e20d2cf
commit 38843e091f
15 changed files with 449 additions and 194 deletions

View File

@@ -156,8 +156,7 @@ function normalizeOrigin(value: string): string {
|| hostname === '[::1]';
if (
!isLoopback
|| parsed.protocol !== 'http:'
|| !parsed.port
|| (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
|| parsed.username
|| parsed.password
|| parsed.pathname !== '/'
@@ -402,6 +401,7 @@ export class PreviewDataSessionManager {
handleAgentBrowserLifecycle(event: AgentBrowserLifecycleEvent): void {
const session = this.session;
if (!session || !samePath(session.snapshot.projectPath, event.projectPath)) return;
if (event.generation !== session.snapshot.browserGeneration) return;
switch (event.type) {
case 'closed':
this.invalidate('preview_closed');