fix: harden assistant authoring and UI
This commit is contained in:
1 parent
fa0e55cc93
commit
edc7b4d55b
51 files changed
+4118
-916
No files matched your search
@@ -0,0 +1,11 @@
|
||||
export const getSafeAssistantHttpUrl = (source: unknown) => {
|
||||
if (typeof source !== "string" || !source) return null;
|
||||
|
||||
try {
|
||||
const url = new URL(source);
|
||||
if ((url.protocol !== "http:" && url.protocol !== "https:") || url.username || url.password) return null;
|
||||
return url.toString();
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user