bito-code-review[bot] commented on code in PR #40658:
URL: https://github.com/apache/superset/pull/40658#discussion_r3342369494
##########
superset/charts/data/api.py:
##########
@@ -617,6 +617,7 @@ def _extract_export_params_from_request(self) -> tuple[str
| None, int | None]:
"""Extract filename and expected_rows from request for streaming
exports."""
filename = request.form.get("filename")
if filename:
+ filename = secure_filename(filename) or None
Review Comment:
<!-- Bito Reply -->
The suggestion is appropriate as it correctly sanitizes the filename input
and handles the edge case where `secure_filename()` returns an empty string.
Using `or None` ensures that the application falls back to a server-generated
filename, which is a secure and robust approach for handling potentially
dangerous or invalid input.
**superset/charts/data/api.py**
```
filename = request.form.get("filename")
if filename:
filename = secure_filename(filename) or None
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]