You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/05 08:27:59 UTC

[GitHub] [airflow] potiuk commented on a diff in pull request #22744: double escape backslash in json

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


##########
airflow/www/templates/airflow/gantt.html:
##########
@@ -79,6 +79,6 @@
   <script src="{{ url_for_asset('gantt.js') }}"></script>
   <script>
     // Loading data via <meta> wasn't loading extra_links in a task
-    const data = JSON.parse('{{ data|tojson }}');
+    const data = JSON.parse('{{ data|tojson|replace("\\", "\\\\") }}');

Review Comment:
   While I see the problem, this always sound suspicious if you want to make such individual replaces. 
   
   Is \\ the only possible problem here? Aren't there ready to use filters we can use to sanitize the input "fully"? 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org