mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
* fix: Escape csv content during downloads * Reuse CsvResponse object * Use correct mimetype for csv responses * Ensure that headers are also escaped * Update escaping logic
This commit is contained in:
@@ -484,12 +484,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
||||
if result_format == ChartDataResultFormat.CSV:
|
||||
# return the first result
|
||||
data = result["queries"][0]["data"]
|
||||
return CsvResponse(
|
||||
data,
|
||||
status=200,
|
||||
headers=generate_download_headers("csv"),
|
||||
mimetype="application/csv",
|
||||
)
|
||||
return CsvResponse(data, headers=generate_download_headers("csv"))
|
||||
|
||||
if result_format == ChartDataResultFormat.JSON:
|
||||
response_data = simplejson.dumps(
|
||||
|
||||
Reference in New Issue
Block a user