jason810496 commented on code in PR #49470:
URL: https://github.com/apache/airflow/pull/49470#discussion_r2151480500


##########
airflow-core/src/airflow/utils/serve_logs.py:
##########
@@ -135,7 +135,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:
   The log files is formatted in NDJSON currently ( for Airflow 2, they are 
even not store in JSON-like format). So changing the response `mimetype` just 
to make the the response type more accurate, will not effect on actual logic.
   
   Additionally, in this PR, we will parsed the log server response in stream 
(`log_streams.append(_stream_lines_by_chunk(io.TextIOWrapper(response.raw)))`), 
so setting the mimetype to `text/plain` is also more suitable.



-- 
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