Fixed content-disposition header on DB download, closes #909

This commit is contained in:
Simon Willison 2020-07-29 14:34:22 -07:00
commit 0748a65a22
4 changed files with 11 additions and 4 deletions

View file

@ -92,7 +92,7 @@ def test_table_csv_download(app_client):
assert response.status == 200
assert "text/csv; charset=utf-8" == response.headers["content-type"]
expected_disposition = 'attachment; filename="simple_primary_key.csv"'
assert expected_disposition == response.headers["Content-Disposition"]
assert expected_disposition == response.headers["content-disposition"]
def test_csv_with_non_ascii_characters(app_client):

View file

@ -913,6 +913,11 @@ def test_database_download_for_immutable():
content_length = download_response.headers["content-length"]
assert content_length.isdigit()
assert int(content_length) > 100
assert "content-disposition" in download_response.headers
assert (
download_response.headers["content-disposition"]
== 'attachment; filename="fixtures.db"'
)
def test_database_download_disallowed_for_mutable(app_client):