mirror of
https://github.com/morluto/rea
synced 2026-10-28 15:07:26 -04:00
fix(inspector): retain observations after capture failures
This commit is contained in:
@@ -47,11 +47,6 @@ export const authorizeRuntimeLocation = async (
|
||||
signal?: AbortSignal,
|
||||
): Promise<RuntimeLocationDecision> => {
|
||||
throwIfRuntimeObservationCancelled(signal);
|
||||
if (value.startsWith("node:") && value.length > 0)
|
||||
return {
|
||||
allowed: true,
|
||||
location: { kind: "builtin", specifier: value },
|
||||
};
|
||||
if (value.startsWith("file:")) {
|
||||
const filePath = await authorizedElectronFile(value);
|
||||
throwIfRuntimeObservationCancelled(signal);
|
||||
@@ -59,6 +54,18 @@ export const authorizeRuntimeLocation = async (
|
||||
? { allowed: false, reason: "not_approved" }
|
||||
: { allowed: true, location: { kind: "file", file_path: filePath } };
|
||||
}
|
||||
return projectReportedRuntimeUrl(value);
|
||||
};
|
||||
|
||||
/** Project non-file Inspector URLs without filesystem access. */
|
||||
export const projectReportedRuntimeUrl = (
|
||||
value: string,
|
||||
): RuntimeLocationDecision => {
|
||||
if (value.startsWith("node:") && value.length > 0)
|
||||
return {
|
||||
allowed: true,
|
||||
location: { kind: "builtin", specifier: value },
|
||||
};
|
||||
let url: URL;
|
||||
try {
|
||||
url = new URL(value);
|
||||
|
||||
Reference in New Issue
Block a user