Skip to content

Commit 1836f90

Browse files
MathiasVDACopilot
andauthored
Update packages/yasgui/src/TabSettingsModal.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9f42c53 commit 1836f90

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/yasgui/src/TabSettingsModal.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,20 @@ export default class TabSettingsModal {
619619
}
620620

621621
// Validate URL format
622+
// Check for supported protocol first
623+
if (!/^https?:\/\//i.test(endpoint)) {
624+
alert("Endpoint URL must start with http:// or https://");
625+
return;
626+
}
622627
try {
623628
new URL(endpoint);
624629
} catch (e) {
625-
alert("Please enter a valid URL.");
630+
// Show the error message if available, otherwise a generic one
631+
alert(
632+
e instanceof Error && e.message
633+
? "Malformed URL: " + e.message
634+
: "Please enter a valid URL."
635+
);
626636
return;
627637
}
628638

0 commit comments

Comments
 (0)