jason810496 commented on code in PR #45914: URL: https://github.com/apache/airflow/pull/45914#discussion_r2069875000
########## airflow/utils/serve_logs.py: ########## @@ -133,7 +133,7 @@ def validate_pre_signed_url(): @flask_app.route("/log/<path:filename>") def serve_logs_view(filename): - return send_from_directory(log_directory, filename, mimetype="application/json", as_attachment=False) + return send_from_directory(log_directory, filename, mimetype="text/plain", as_attachment=False) Review Comment: I didn’t consider backward compatibility for serving logs during the initial implementation. That said, we’re using `send_from_directory` here, so regardless of the MIME type specified (`application/json` or `text/plain`), the raw file is still served as-is. Also, on the client side (`_read_from_logs_server`), the old implementation uses `response.text` instead of `response.json()`: https://github.com/apache/airflow/blob/v2-10-test/airflow/utils/log/file_task_handler.py#L615 So this change shouldn’t break backward compatibility. Using `text/plain` here just makes it more semantically correct, since the client expects and handles plain text. -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org