ashb commented on a change in pull request #7472: [AIRFLOW-6850] Handle no
access to code in UI
URL: https://github.com/apache/airflow/pull/7472#discussion_r382568842
##########
File path: airflow/www/views.py
##########
@@ -529,7 +529,7 @@ def code(self, session=None):
html_code = highlight(
code, lexers.PythonLexer(), HtmlFormatter(linenos=True))
except OSError as e:
- html_code = str(e)
+ html_code = 'Failed to load file.<br/> Details: ' + str(e)
Review comment:
```suggestion
html_code = 'Failed to load file.<br/> Details: ' +
escape(str(e))
```
Should use
https://flask.palletsprojects.com/en/1.1.x/api/?highlight=safe#flask.escape
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services