potiuk commented on code in PR #41995:
URL: https://github.com/apache/airflow/pull/41995#discussion_r1743910036


##########
airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx:
##########
@@ -57,8 +57,27 @@ const ExtraLinks = ({
     if (!url) {
       return true;
     }
-    const urlRegex = /^(https?:)/i;
-    return urlRegex.test(url);
+    try {
+      const path = new URL(url);
+      // The URL creation will succeed for
+      // 1. Absolute URL
+      // 2. URL with javascript:()
+      // URL(url) will fail for relative paths.
+      // eslint-disable-next-line
+      if (path.protocol === "javascript:") {

Review Comment:
   We likely don't need to check it here - since only http/https are allowed 
below.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to