We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 772568b commit 52215d5Copy full SHA for 52215d5
client/src/pages/TriggerWorkflowForm/TriggerWorkflowForm.jsx
@@ -17,7 +17,18 @@ const TriggerWorkflowForm = () => {
17
const type = searchParams.get('type');
18
const triggerUrl = searchParams.get('triggerUrl');
19
20
- if (triggerUrl !== null) {
+ const triggerUrlPattern = /^https:\/\/(?!.*javascript)[^()]+$/i;
21
+
22
+ function isValidTriggerUrl(url) {
23
+ try {
24
+ // Check if it's a valid URL and matches the pattern
25
+ return triggerUrlPattern.test(decodeURIComponent(url)) && new URL(url);
26
+ } catch {
27
+ return false;
28
+ }
29
30
31
+ if (triggerUrl !== null && isValidTriggerUrl(triggerUrl)) {
32
return (
33
<div className="page-box">
34
<Header />
0 commit comments