Test Content-Encoding against Content-Disposition, URL and body

This commit is contained in:
Adrián Chaves 2023-01-10 20:51:43 +01:00
parent ff37b274a6
commit 86baef02a0
1 changed files with 37 additions and 0 deletions

View File

@ -500,6 +500,43 @@ POST_XTRACTMIME_SCENARIOS = (
)
),
# Compressed content should be of type Response until uncompressed.
(
{
'headers': Headers(
{
'Content-Disposition': [
'attachment; filename="a.html"',
],
'Content-Encoding': ['zip'],
}
)
},
Response,
),
(
{
"url": "file:///a.html",
'headers': Headers(
{
'Content-Encoding': ['zip'],
}
)
},
Response,
),
(
{
"body": b"<html>",
'headers': Headers(
{
'Content-Encoding': ['zip'],
}
)
},
Response,
),
# If the body is empty, it contains no binary data bytes, hence body-based
# MIME type detection must interpret the result as text.
#