This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-10-test by this push:
     new 6fe8e8ffcb Adding rel property to hyperlinks in logs (#41696) (#41783)
6fe8e8ffcb is described below

commit 6fe8e8ffcbab0529bbbfbc490114779eb0367a26
Author: Amogh Desai <[email protected]>
AuthorDate: Tue Aug 27 13:42:30 2024 +0530

    Adding rel property to hyperlinks in logs (#41696) (#41783)
    
    * Adding rel property to hyperlinks in logs
    
    * fixing tests
    
    (cherry picked from commit 79db243d03cc4406290597ad400ab0f514975c79)
---
 airflow/www/static/js/dag/details/taskInstance/Logs/utils.test.tsx | 4 ++--
 airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/utils.test.tsx 
b/airflow/www/static/js/dag/details/taskInstance/Logs/utils.test.tsx
index bcebb22ec9..ce6b082cb1 100644
--- a/airflow/www/static/js/dag/details/taskInstance/Logs/utils.test.tsx
+++ b/airflow/www/static/js/dag/details/taskInstance/Logs/utils.test.tsx
@@ -147,10 +147,10 @@ describe("Test Logs Utils.", () => {
 
     const lines = parsedLogs!.split("\n");
     expect(lines[lines.length - 1]).toContain(
-      '<a href="https://apple.com"; target="_blank" style="color: blue; 
text-decoration: underline;">https://apple.com</a>'
+      '<a href="https://apple.com"; target="_blank" rel="noopener noreferrer" 
style="color: blue; text-decoration: underline;">https://apple.com</a>'
     );
     expect(lines[lines.length - 1]).toContain(
-      '<a href="https://google.com"; target="_blank" style="color: blue; 
text-decoration: underline;">https://google.com</a>'
+      '<a href="https://google.com"; target="_blank" rel="noopener noreferrer" 
style="color: blue; text-decoration: underline;">https://google.com</a>'
     );
   });
 });
diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts 
b/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
index 2123f48001..4be81a6d0c 100644
--- a/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
+++ b/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
@@ -137,7 +137,7 @@ export const parseLogs = (
       const lineWithHyperlinks = coloredLine
         .replace(
           urlRegex,
-          '<a href="$1" target="_blank" style="color: blue; text-decoration: 
underline;">$1</a>'
+          '<a href="$1" target="_blank" rel="noopener noreferrer" 
style="color: blue; text-decoration: underline;">$1</a>'
         )
         .replace(logGroupStart, (textLine) => {
           const unfoldIdSuffix = "_unfold";

Reply via email to